This post is in Draft Mode - it will not appear on the site or in search results
So you've made changes against your local master branch and want them somewhere else
Happy Path - Git Workflow #
- Checkout origin/master
- Create a local branch
- Commit local changes
- Push branch to origin
- Submit PR into origin/master
- Checkout local master and pull in changes
Your local master branch should always reflect what's on origin/master. If it doesn't, you can always reset it by deleting your local copy and pulling in a checking out a fresh version from master
Common Pitfalls #
1. Help, I made changes against my local master branch #
Create a new branch
- Working Copy Parent
- Checkout new branch
git checkout -b new_branch_name
2. Help, I made changes that I want to apply to a different branch instead #
- stash local changes (puts every local delta in a "stash")
- switch to any branch
- apply stash to branch