-
Notifications
You must be signed in to change notification settings - Fork 34
2.0.0 Working with Git
smutniak edited this page Jul 15, 2019
·
1 revision
- Create a local working branch
git branch working
- Go to your local working branch
git checkout working
- Make changes
hack hack hack hack
- Commit changes
git add -A
git commit -m 'lots of cool stuff'
- Get updates from remote server and switch back to the develop branch
git fetch
git checkout develop
- If the git fetch pulled updates from the server, then:
git merge origin/develop
git checkout working
git rebase develop
git checkout develop
git merge working
git push origin develop
- If you get a conflict on the push to origin (last line), you'll need to rebase your local changes on top of the remote branch:
git rebase origin/develop
- And then re-push:
git push origin develop
- Else if the git fetch didn't pull any updates from the server, then:
git merge working
git push origin develop
-
You can use
gitx —all
at any time to see the history of each branch. -
When you're ready to develop more code, go back to step 2.
-
You can use multiple working branches if you are developing multiple features at once that you don't want to mix together. Just create a different local branch and replace
working
above with your local branch name.