-
Notifications
You must be signed in to change notification settings - Fork 39
git commands
Josh Greig edited this page Feb 18, 2017
·
12 revisions
Say you are working on a new issue:
- git branch issue-63 // assuming 63(sign up page) is the issue you’re working on
- git checkout issue-63
- Implement and test the changes you want.
- git add file1.txt
- git add file2.txt //////////// any files you updated
- git commit –m “app: changed files… describe this better”
- git push origin issue-63 –f //////////// to get the branch on github
Say you want to get some changes that were merged recently on github.
- Commit changes to your non-master branch like issue-63 if there are any.
- git checkout master
- git pull origin master
Say you want to get latest changes on a branch you’re working on:
- Same steps as above to get latest on your master branch.
- git checkout issue-63 (whatever branch you’re working on)
- git rebase issue-63
- Either it says “Successfully rebased…” after 10 seconds or so and your done or you’ll run into a rebase conflict which is handled by the next steps.
- git status (shows you what files need manual review for rebasing)
- Update the files. The ones needing review should have lines like >>>>>>> and <<<<< marking lines needing your attention.
- When you’re satisfied with the changes, run “git add file1.txt” assuming that’s a file you manually updated. Add all the files you updated.
- git rebase --continue
- You might have to do steps 6 and 7 more than once but eventually you should get to the “Successfully rebased…” message from step 4.
Referencing an issue or pull request To reference an issue or pull request on github, add a #{issue or pull request number} to your git commit message. For example, #216 will point to issue 216(User Profile: State/Province/Territory "region" Data Table).