53. Git ow
A Git ow work ow is a more formal,
structured extension to feature branching,
making it a great option for larger teams with
well-de ned release cycles.
55. Forking (Public GitHub)
Finally, consider a forking work ow if you
need maximum isolation and control over
changes, or have many developers
contributing to one repository.
56. Feature Branch
Building on that idea, using a feature branch
work ow lets developers keep their work in
progress isolated and important shared
branches protected. Feature branches also
form the basis for managing changes via pull
requests.
91. Fetch and merge changes on the remote server to your
working directory
git pull
92. To merge a different branch into your active branch
git merge branchname
93. View all the merge con icts:View the con icts against the
base le:Preview changes, before merging
git diff —base lename
git diff sourcebranch targetbranch
94. After you have manually resolved any con icts, you mark the
changed le
git add lename
100. If you mess up, you can replace the changes in your working
tree with the last content in head:Changes already added to
the index, as well as new les, will be kept.
git checkout — lename
101. Instead, to drop all your local changes and commits, fetch the
latest history from the server and point your local master
branch at it, do this
git fetch origin git reset —hard origin/master
155. BEST PRACTICES
Use a descriptive commit message
Link Commits to Issues (Feature, Bug, Task)
Make each commit a logical unit
Incorporate others' changes frequently
Share your changes frequently
Don't commit generated les
156. RESOURCES
Pro Git
Try Git right in your web browser
Smart Commit commands
Online Training
Markdown Cheatsheet
GitHub Enterprise Resources
A successful Git branching model
GitHub Help
Git-SCM