
More...
Update to my evolving list of notes on using git in day to day development. In some cases these are just the best methods I've found thus far, comments and suggestions are welcome. Sorry for the raw format. :) Phasing use of cogito out for raw git usage, most of it is now gone.
Getting Set Up
Edit ~/.ssh/config:
Host git.dangerouslyinc.com
User herk
Port 2223
Checking out:
git clone git+ssh://git.dangerouslyinc.com/git/wuja
Identify yourself:
git repo-config user.name "Awesome Haxor"
git repo-config user.email "ahaxor@dangerouslyinc.com"
Update:
git pull
Commit locally:
git-commit -a
Workflow
Branching
List:
git branch
Create 'new' branch:
git branch new
Switch to branch:
git-checkout new
Publish local branch:
git push git+ssh://git.dangerouslyinc.com/git/revelation splashid:splashid
Checkout branch elsewhere:
git pull git+ssh://git.dangerouslyinc.com/git/revelation splashid:splashid
Merge master into branch:
git-merge master
Generating Patches
git-format-patch origin
Reverting Uncommitted Changes
git-checkout file-to-revert
git reset HEAD <file>
Diff
Generate diff between two commit IDs:
cg diff -r 0fa7b047ad8968f5996029071e04cb9b4f2831b9..234cde4eb65cc903e40a98f4d87eea9ae28f7ef4
Diff most recent commit:
git diff HEAD^ HEAD
Tags
Create and push a tag:
cg tag 0.0.5
git push --tags
Repositories
Tracking svn:
git-svn init svn://url
git-svn fetch
git-clone rhn.git newrepodir
git-svn dcommit
Creating a new remote repository:
# Upload .git dir
git --bare update-server-info
chmod +x hooks/post-update
Misc
Create a tarball for release:
git archive --format=tar --prefix=wuja-0.0.8/ HEAD | gzip >~/rpmbuild/SOURCES/wuja-0.0.8.tar.gz
Clone to send to someone:
git clone --bare my-project