Saturday, October 13, 2012

git remind


And I will begin with :
git checkout revision/branch path/to/file
for checking out into the working tree a particular version of a particular file. So :
git checkout HEAD path/to/file
would revert all changes in file relative to the last commit index.

Push a local branch to a different remote branch :

git push -v -u remote_repo local_branch:remote_branch
as in git push -v -u origin github:master. -v is verbose -u is to set the local tracking the remote branch. Add -n for dry-run.
Push all branches/tags up to the remote repo :

git push --all
git push --tags

From here. Don't be in a hurry though - make sure you really want to push everything.

See all commits  messages in a range between commits abc... and def... affecting a single file :

git log oldhash..newhash -- path/to/inspect
 notice the 2 dots.

Ah - the subject of gitignore - this merits a post but for starters here is the syntax.
See all files that have the assume unchanged bit set :
git ls-files -v
I use the msgit gui to stage/commit separate lines/hunks. If ever interested in how one can do this via console (which sounds like an absolute chore) here is a great post about that.

Free private git repos are sought after. I went for assembla for a (school) project were I needed many (>5) people - but I'd go for bitbucket (I like the UI better). Github unfortunately does not offer private for free. Anyway - from the previous post I got two links describing how one could set up a git repo on their Dropbox account.

Links :

Git Reference
For windoz : http://nathanj.github.com/gitguide/tour.html

2013.09.21 19.01 UTC