Created
October 19, 2010 18:33
-
-
Save clyfe/634764 to your computer and use it in GitHub Desktop.
Shows common git commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################### | |
### Set a remote repo ### | |
######################### | |
# via ssh | |
> mkdir projectdir.git | |
> cd projectdir.git | |
> git init --bare | |
or use http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way | |
################# | |
### Beginners ### | |
################# | |
git init # creates local git repo | |
git status # show what is changed & what is staged | |
git add . # stages all changes in current directory | |
git commit -am "some message" # commits all staged changes | |
# copy a remote repo to a local repo | |
git clone git@github.com:clyfe/active_scaffold.git active_scaffold | |
git push origin master # send local commits to remote repo | |
# submodules | |
git submodule add git@github.com:clyfe/active_scaffold.git vendor/plugins/active_scaffold | |
git submodule init | |
git submodule update | |
http://www.hackido.com/2009/01/quick-tip-remove-git-submodule.html | |
# files | |
.gitmodules # submodules file | |
.gitignore # ignore list glob's | |
################ | |
### Advanced ### | |
################ | |
git remote add upstream git://github.com/vhochstein/active_scaffold.git # set up remote upstream | |
git checkout -b 100-branch-name # create a branch for new issue | |
git fetch upstream # fetch upstream changes | |
git checkout master; git pull upstream master # update local master | |
git checkout 100-branch-name; git rebase master # rebase issue branch | |
git push origin 100-branch-name # push branch to remote | |
git pull --rebase volker master # pull by rebase | |
https://github.com/dchelimsky/rspec/wiki/Topic-Branches | |
https://github.com/diaspora/diaspora/wiki/Git-Workflow | |
http://pacific.mpi-cbg.de/wiki/index.php/Git_topic_branches | |
http://ariejan.net/2008/04/23/git-using-the-stash/ | |
http://mislav.uniqpath.com/2010/07/git-tips/ | |
################## | |
### SHOW STUFF ### | |
################## | |
git reflog show | |
#################### | |
### FIX MISTAKES ### | |
#################### | |
http://markpasc.livejournal.com/189329.html | |
http://nuclearsquid.com/writings/git-tricks-tips-workflows.html | |
http://sandofsky.com/blog/git-workflow.html | |
http://gitref.org/ | |
http://ndpsoftware.com/git-cheatsheet.html | |
http://learn.github.com/p/intro.html | |
http://eagain.net/articles/git-for-computer-scientists/ | |
http://think-like-a-git.net/ | |
#################### | |
### TOOLS ### | |
#################### | |
https://github.com/nvie/gitflow | |
https://github.com/rtomayko/git-sh | |
https://github.com/jinzhu/grb | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment