Git Workflow
Quick Links
- Git for Subversion Developers, Quick Reference - https://git.wiki.kernel.org/index.php/GitSvnCrashCourse
- A great collection of git notes: http://sitaramc.github.com/index.html
- How Git works - http://eagain.net/articles/git-for-computer-scientists/
- IBM's view on Git for Subversion Developers - http://www.ibm.com/developerworks/linux/library/l-git-subversion-1/
- Move code from one project to another with history - http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
- How to move folders between git repositories - http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
- ACK! The various types of resetting - http://git-scm.com/2011/07/11/reset.html
Which Workflow is for Me?
- I am a project committer: Git Workflow for Committers
- I am a project contributor (no commit access): Git Workflow for Non-Committers
- I am maintaining local customizations: Git Workflow for Vendor Branching
On This Page
Commit Message Formatting
Git and most Git tools have a convention for commit message formatting where the message is comprised of a one line summary that starts with the Jira issue ID (50 characters or less), a blank line and then an optional detailed description. Think of it like the subject and then body of an email. A more detailed description can be found here:Â https://github.com/blog/926-shiny-new-commit-styles
Tips, Tricks, and Useful Commands
- Visualizing your local repository
gitk
- Checkout a remote branch to a new local branch
git checkout -t origin/branchname
- Show the current status of your local working copy
git status
- Perform a diff of your local working copy, including files that have been staged for commit (git add)
git diff --cached
- Add specific changes to commit
git add path/to/file
- Commit all locally changed files
git commit -a
- Remove local changes from the working directory but keep track of them for later use
git stash
- Apply stashed changes
git stash pop