Exercise to practice collaborative centralized workflow. On the way to a pull request and code review we will meet and discuss a number of typical pitfalls.
- Participants add their usernames to a shared document.
- Instructor adds participants as collaborators to this project.
If you have set up ssh keys:
$ git clone [email protected]:coderefinery/centralized-workflow-exercise.git
If you have not set up ssh keys:
$ git clone https://github.com/coderefinery/centralized-workflow-exercise.git
$ cd centralized-workflow-exercise
In this file share your favourite cooking recipe or haiku or Git trick or whatever.
$ git add yourusername.txt
$ git commit
$ git push origin master
It will work only for one participant. Why?
$ git pull origin master
Ideas? What happened under the hood? Discuss git fetch
as an alternative to git pull
.
Discuss git pull --rebase
as an alternative to avoid merge commits.
It will work for one more person.
$ git branch yourname/somefeature
$ git push origin -u yourname/somefeature
Can we leave out the -u
?
Submit a pull request from your branch towards the master
branch.
Do this through the web interface.
- Instructor removes collaborators.
- Instructor rewinds the repository to the state before the exercise.