-
Notifications
You must be signed in to change notification settings - Fork 1
GoodGitPractices
stevepublic edited this page Dec 5, 2019
·
14 revisions
This is a brief cheat sheet for good practices as we use Github for QUDT. There are essentially three stages:
- Ensure you are up to date:
git checkout master
git pull
- Create a new branch for your work. Please name your branch beginning with your initials, a hyphen, then some topical name:
git checkout -b srr-mynewbranch
- Do all your changes and additions and testing on this branch (srr-mynewbranch in above example). This might last for days or more.
- Check that all the changed files are the ones you intended using the 'git status' command below.
git status
- If so, add them for tracking (you can also add individual files or files satisfying regular expressions):
git add -A
- Frequently commit, so that each change can be tracked and rolled back if needed.
git commit -m 'Descriptive message about the change'
- Bring in the latest changes in master before you push:
git checkout master
git pull
git checkout srr-mynewbranch
git merge master
- Push your branch to the remote. The first time, you'll need to create the branch on the remote:
git push --set-upstream origin srr-mynewbranch
Later, when you are on your branch, you can just say
git push
Blah blah Another blah blah from testbranch
dfdfd