Git

From Things and Stuff Wiki
Revision as of 04:22, 10 January 2012 by Milk (talk | contribs) (http://www.manpagez.com/man/1/git-submodule/)
Jump to navigation Jump to search


Reference

man git-push, git-branch, git-submodule

Commands

git config color.ui true
git config format.pretty oneline
git add . - add file to staging
git add * - add all (except those in .gitignore) files to staging
git reset --hard HEAD - reset any uncommitted changes
git reset --hard origin/master - reset from remote master
git remote add origin <server>
git remote show origin
git pull origin master - get master branch from origin remote
git push otherrepo <branch> - stick branch on otherrepo remote
git checkout <branch> - checkout branch
git checkout -- <file> - checkout file from HEAD
git checkout -b <branch> - create and checkout new branch
git branch -d <branch> - delete branch
git branch - list branches
git branch -a - list branches (including remote)
git merge <branch> - merge branch, keep branch in commit log
git rebase <branch> - merge branch, hide branch in commit log (?)
git diff master <branch> - show difference between master and another branch
git tag - list repo tags
git tag 1.0 <sha> - tag <sha> with 1.0
git log - list commits with message and sha
git submodule add git@mygithost:project goes/here --branch x.y
git repo-config core.sharedRepository true - allow access by multiple users

Zsh prompt symbols

Status:
✔:	repository clean
●n:	there are n staged files
✖n:	there are n unmerged files
✚n:	there are n changed but unstaged files
…:	there are some untracked files

Branch:
↑n:	ahead of remote by n commits
↓n:	behind remote by n commits
↓m↑n:	branches diverged, other by m commits, yours by n commits
::	hash, not a branch

Guides

Articles

Handy

Submodules

Repos

Git used for private repo, with Gitweb for easy overview.

For a public setup, a hosting system with access control like gitosis or gitolite is required, or for public read only, git-daemon would do.