User Tools

Site Tools


git:git_chectsheet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
git:git_chectsheet [2011/10/07 11:18] devagit:git_chectsheet [2012/08/01 12:48] (current) – removed deva
Line 1: Line 1:
-======GIT CheatSheet====== 
-=====List current status (including changes) in repo===== 
-<code>git status</code> 
  
-====List files in repo==== 
-<code>git ls-files</code> 
- 
-====List deleted files in repo==== 
-<code>git ls-files -d</code> 
- 
-=====Undelete file===== 
-<code>git checkout filename</code> 
- 
-====Undelete all deleted files==== 
-<code>git ls-files -d | xargs git checkout --</code> 
- 
-=====Mark conflict as resolved===== 
-''filename'' will have merge conflicts marked in the same way used in CVS. 
-<code>git add filename</code> marks the conflict as resolved. 
- 
-=====Turn off pager===== 
-<code>git --no-pager [command]</code> 
-Run <code>alias git='git --no-pager'</code> to disable it on all commands in the current shell. 
-Alternatively set ''core.pager = '' in .gitconfig (it is set to the empty string.) to disable it entirely for that user. 
- 
-=====Tags===== 
-====Create==== 
-<code> 
-git tag -a v1.4 -m 'version 1.4' 
-</code> 
- 
-====List==== 
-All: 
-<code> 
-git tag 
-</code> 
-Or filtered: 
-<code> 
-git tag -l v1.* 
-</code> 
- 
-====Show==== 
-<code> 
-git show v1.4 
-</code> 
- 
-====Push==== 
-By default, the ‘git push’ command will not transfer tags to remote servers. To do so, you have to explicitly add a –-tags to the ‘git push’ command. 
- 
-=====Branches===== 
-====List branches==== 
-<code> 
-git branch 
-</code> 
- 
-====Switch to branch==== 
-<code> 
-git checkout [branchname] 
-</code> 
- 
- 
-=====CVS 2 GIT===== 
-<code> 
-git cvsimport -k -i -d server:/path/to/CVSHOME -C git_reponame cvs_reponame 
-</code> 
-The resulting git_reponame directory now contains the .git folder which can be moved to a server location for shared access. 
-Run ''git update-server-info'' in the new server folder in order to make it shareable. 
git/git_chectsheet.1317979123.txt.gz · Last modified: 2011/10/07 11:18 by deva