This is an old revision of the document!


git

Get hash tag of last commit
git log -1 --format=oneline | cut -d " " -f 1
Configure pager

This will cause less to exit as soon as it reaches end-of-file. This is helpful for git output where it is less than one page.

Edit your .gitconfig file:

[core]
pager = less -E

Here are some useful commands:

# initialize working copy
git init
 
# initialize bare repo
git init --bare
 
# reset working copy
git reset --hard
 
# show who is responsible for changes
git blame
 
# add remote
git remote add origin user@blah/~/foo/bar/
 
# remove remote
git remote rm origin
 
# show all remotes
git remote show
 
# show details of specific remote
git remote show origin
 
# pull any changes down from the bare
git pull origin master
 
# make a new branch and start working in it
git checkout -b some_updates
 
# make a working copy of existing repo
git clone user@blah/~/foo/bar/
 
# get the status of current branch
git status
 
# delete branch locally
git branch -D newfeature
 
# delete branch on origin
git push origin :newfeature