-
Notifications
You must be signed in to change notification settings - Fork 4
Project Workflow in Git and GitHub
andrzejp edited this page Dec 15, 2017
·
6 revisions
- Fork this repository onto your own GitHub account.
- Open Git Bash.
- Change the current working directory to your local project.
- Clone the repository you have forked.
- Add the original repo as upstream with the following command in the terminal.
git remote add upstream https://github.com/chingu-voyage3/toucans-20.git
The upstream will have a master branch and a development branch
Run git status regularly to see if your local master is up to date. If not, follow the below steps to keep local master always up to date with upstream/master.
- Check out master.
git checkout master - Pull the master branch from the upstream repository.
git pull upstream master - Commit the merge.
Work on your feature one personal branch. You can name this anything you want. Do not work on your local master branch, because it will make it more difficult to keep your local in sync with the remote.
To create a branch run git checkout -b YOUR-CHOSEN-BRANCH-NAME
When you're ready with your feature and it works on your local:
- Fetch the development branch from the origin master.
git fetch upstream development - Merge it into your feature branch locally. If there are conflicts, resolve them.
git merge YOUR-BRANCH-NAME upstream/development - Make sure your
masteris up to date. - Push local
masterandYOUR-BRANCH-NAMEfeature branch into your fork.
git push origin master
git push origin YOUR-BRANCH-NAME - Create a pull request to pull onto the chingu-voyage3/toucans-20
developmentbranch from the YOUR-BRANCH-NAME in your Fork. Fix any issues - there shouldn't be any because you fixed all conflicts locally, but in the event that someone already made changes to the branch while you were doing the above steps, you can review the changes and merge solve the conflict in GitHub. We'll cross this bridge when we get to it. Approve the request yourself if there are no issues. - Request to pull the chingu-voyage3/toucans-20
developmentbranch into themasterbranch. Let this request be reviewed by team members.
BOOM