git-push-origin
Git Push Origin
Push a local branch to origin to initialize it on the remote (GitHub).
When to Use
- New branch needs to exist on GitHub
- First push of a local branch
- Setting up remote tracking
- Any request to "push branch to origin" or "init branch on GitHub"
Workflow
1. Check Current State
git status
git branch --show-current
git remote -v
2. Push with Upstream Tracking
First push (initialize on origin):
git push -u origin <branch-name>
Or using the current branch:
git push -u origin HEAD
3. Verify Remote Branch
git branch -vv
git log --oneline --graph --decorate -5
Common Scenarios
Push current branch for the first time:
git push -u origin HEAD
Push specific branch:
git push -u origin feature/my-feature
Push after making commits:
git add .
git commit -m "feat: initial implementation"
git push -u origin HEAD
What -u (Upstream) Does
The -u flag sets up tracking between local and remote branch:
- Future pushes can use just
git push - Future pulls can use just
git pull - Shows tracking info in
git branch -vv
Best Practices
- Always use
-uon first push to set upstream - Push after initial commit(s) to back up work
- Verify branch appears on GitHub
- Ensure you're on the correct branch before pushing
More from pc-style/pc-skills
blog-post
Create pcstyle.dev developer blog posts in the dual-author (ME MYSELF + MY AI AGENT) format, including MDX structure, custom components, and API/CLI publishing steps.
4code-review
Run automated code review using cubic review with amp review fallback. Use when the user wants to review code changes, check PR quality, analyze code for issues, or run automated code review tools.
4load-handoff
Load a handoff file and proceed with the specified tasks. Use when starting a new session with a HANDOFF.md file present, or when the user asks to continue from a handoff. Reads the handoff context and immediately begins executing the next steps.
3explore-codebase
Fast codebase exploration using Opencode's Explore agent for quick recognition of project structure, file patterns, and code organization. Use when you need to understand a codebase quickly, map out architecture, find files by patterns, or answer questions about code structure. Triggers on requests like "explore this codebase", "understand the project structure", "map out the architecture", or when quick file discovery is needed.
3create-handoff
Create a handoff message to continue work in a new AI session. Use when the user wants to save context for later, create a handoff document, or prepare work for continuation in a fresh session. Captures relevant files, context, and goals so the next session can start immediately without rediscovering the codebase.
3git-commit-push
Stage changes, commit with conventional commits, and push to origin. Use when the user wants to commit and push in one go, save changes to GitHub, or after completing work on a branch. Combines staging, committing, and pushing into a single workflow.
3