Note: I recommend installing Homebrew if you’re using macOS. Link
- Fork repo (button, top right corner)
- Clone your fork locally via the terminal:
git clone https://github.com/YOUR_USERNAME/YPC-scrum.git
- CD into directory
cd YPC-scrum
- Check existing branches
git branch -v
- Check the remote repos
git remote -v
. It should say:origin https://github.com/user/repo.git (fetch)
origin https://github.com/user/repo.git (push)
- Add the upstream repo (original repo) in terminal:
git remote add upstream https://github.com/ZakStrassberg/YPC-scrum.git
- If you get
fatal: remote origin already exists.
, troubleshoot here. - This will be used to pull from the master branch
- Check if the upstream was added correctly
git remote -v
- Never work on the master branch. It is good to have one person maintain the master branch and all others working on unique branches.
- Create a new branch for the feature you want to make (try to be descriptive and include your name)
git checkout -b alex-readme
- Double check the branch was made and you're on it
git branch -v
- Once you're written some code, you can use your origin (GitHub remote repo) to save your branch's progress
git add .
git commit -m "commit message here"
git push origin alex-readme
- Switch to your master branch
git checkout master
- Verify that your master branch is up to date with the upstream master.
git pull upstream master
- Merge your development branch into your master branch.
git merge alex-readme
- If you experience conflicts at this stage, stop and review the conflicts. Try
git mergetool
or download GitKraken.
- If you experience conflicts at this stage, stop and review the conflicts. Try
- Push your changes to your GitHub master branch.
git push origin master
- Go to your GitHub repo and select the master branch.
- Click the button for New pull request (to the right of the branch selection).
- You will be shown two branches to compare. If it says "Able to merge" with a checkmark, you can click the create pull request button. If not, please wait to merge and discuss with your team.
- There will be a textbox and a subject line with your last commit message. Update the subject line to something relevant to feature you implemented. Leave detailed comments in the textbox if there are specific things you want to let the maintainer know.
- Click the Create pull request button.
- The repo maintainer should notify you when the upstream master has been updated.
- Save your current work on your development branch.
git add .
git commit -m "commit message"
git push origin YOUR-BRANCH-NAME
- Switch to master branch.
git checkout master
- Verify that the remote upstream exists and is the correct address
git remote -v
- Pull the changes from upstream into your master branch
git pull upstream master
- Switch back to your development branch and continue working
git checkout YOUR-BRANCH-NAME
- SSH into your instance: update your files (such as settings.py with the IP address of your instance)
git stash
- Switch to your terminal window for your computer.
- make changes locally on your computer
git add .
git commit -m "COMMIT MSG"
git push origin master
(get your changes on github)- SSH into your instance:
git pull
(from your instance, get your changes onto your instance) git stash pop
(throws away the stash after applying it)- The changes you made on the instance will merge with the updates you made locally.
- Fork repo (button, top right corner)
- Clone the main project locally via the terminal (from the main owner's GitHub page):
git clone https://github.com/THEIR_USERNAME/YPC-scrum.git
- CD into directory
cd YPC-scrum
- Check existing branches
git branch -v
- Check the remote repos
git remote -v
. It should say:origin https://github.com/THEIR_USERNAME/repo.git (fetch)
origin https://github.com/THEIR_USERNAME/repo.git (push)
- Add your github repo as "me" in terminal:
git remote add me https://github.com/YOUR_USERNAME/YPC-scrum.git
- Check if "me" was added correctly
git remote -v
- Now the syntax is different:
- To update your GitHub repo:
git push me
- To pull an update from the main repo:
git pull
- To update your GitHub repo: