Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Thursday, 13 February 2014

When git cloning locally...


If you clone a local git repository while you are on a given branch, also the new clone will be on that branch.
This is solvable by some easy git fetch but the HEAD will point to the first branch, and will give you headaches when you have to rebase.

the solution is *not* set-upstream, which will track changes from another remote by default, but *set-head* which will point to another local branch.

So, to restore sanity

git remote set-head origin master

Monday, 3 June 2013

Fast authors for Mercurial

In case you need to find out who commited the first version of a file to a Mercurial repository, there is this little command that does so quickly.

hg log -r 'first(file("path/to/file"))' --template '{author}\n' -f
 
This is using hg log together with hg templating. You can customize your output with stuff like {date|isodate} or {desc). -f follows through renames and removals.



All the projects here are under a Creative Commons 3.0 licence! You can use and distribute them as you like (just quote the author so he knows his work is not useless)!

If you wish to get in touch with me write at projectsymphony@gmail.com