how to track multiple svn branches in git
[ link: svn-branches-in-git | tags: git svn scm | updated: Mon, 03 Mar 2008 21:27:21 ]
I must say that I am no fan SVN, but SVN and I get a long a lot better since I started using git-svn. Long ago a good friend of mine, Dave O'Neill, taught me how to handle multiple branches using git-svn. I had used that technique until Dave taught me how to do it better.
Recently I saw this blog post which referenced Dave's article talking about the first method. I guess Dave never got around to updating his blog with the better way. So I am going to do that here:
git-rebase --interactive
[ link: git-rebase-interactive | tags: git scm | updated: Sun, 09 Sep 2007 20:43:19 ]
MadCoder wrote today about git-rebase --interactive which is a new feature in git that allows you to easily reorder, or fix patches already applied to the current branch by editing a file... very neat.
git-svnup
[ link: git-svnup | tags: git svn scm | updated: Tue, 07 Aug 2007 11:29:58 ]
My employer (or client, since I am a contractor there) uses svn. I prefer to use git.
This following git allows me to update all tracked svn branches in my git-svn repository:
git config --get alias.svnup
!git-config --get-regexp 'svn-remote.*url' | cut -d . -f 2 | xargs -n1 git-svn fetch
The way to invoke it is to run:
git svnup
git-svn rebase some-remote-snv-branch
You need to put that into your ~/.gitconfig like so:
[alias]
svnup = !git-config --get-regexp 'svn-remote.*url' | cut -d . -f 2 | xargs -n1 git-svn fetch
git-clean in svn land
[ link: svn-clean | tags: svn scm | updated: Tue, 10 Jul 2007 21:50:08 ]
Some things are easier in git. For example to nuke all changes and only keep files that are tracked by git I would run:
git-clean -d -x
git-checkout -f
In svn it's a bit more involved, but not impossible:
svn status --no-ignore | awk '{print $2}' | xargs rm -rf
svn revert -R .
svn update
For extra fun... the svn revert -R will actually stop on any symlinks to directories. Fun!
git caching for v1.5.x
[ link: git-1.5-caching | tags: scm git | updated: Wed, 21 Feb 2007 04:52:36 ]
I wrote about git caching several months back. The term, git caching, was something I had given a local repository that can be used as a reference for multiple projects. New features in the recently released git 1.5.x requires that I blog again about this great tool.
Recap: I am working on a linux patch -- klips to be specific. I have more repositories then I know what to do with. Git has this cool feature where it can point to another directory to find it's object files, this is called alternate or reference repository.
fetching all git branches from remote
[ link: fetch-all-git-branches | tags: git scm | updated: Wed, 22 Nov 2006 09:50:06 ]
When you clone a new git repository, using a recent git release, by default git
will create a .git/remotes/origin with all remote branches. This file lists
all remote branches that are to be updated on a fetch.
Over time the remote may get more branches, and it may be necessary to update the
remote branch list. The way to find out what is available at a remote is to
call git-ls-remote origin, then pick out the branches of interest, and add them
to the .git/remotes/origin file.
local caching for git repos
[ link: git-caching | tags: git scm | updated: Mon, 30 Oct 2006 09:36:23 ]
I try to minimize the amount of data I pull from git repositories. To do this I have a
directory on my file server that has a bunch of clones of git (and hg and previously bk)
repositories. All of these are exported and mounted on my other machines in /site/scm/.
I will refer to this as cache :)
Next, I have a cron job that regularly updates those trees from the their upstream
counterparts. All my working copies are cloned from those repositories using the
--local --shared mode, or using --reference if I think I will be committing
upstream any time soon.
automatic version creation with git
[ link: auto-git-versioning | tags: git scm | updated: Fri, 20 Oct 2006 15:15:22 ]
openswan is going through a process of redefining what their versions numbers will mean... what's stable, what's testing, what's devel, etc.
I participated in the discovery of how to do this automagically from git release tags. Patrick was so happy with the results that the conversation ended with ...
14:49 <patlap> C'mon bart, blog it :-)
... and how can I tell the CEO of Xelerance "no" :)
reverting a git changeset
[ link: manual-git-revert | tags: git scm | updated: Fri, 02 May 2008 10:02:23 ]
I accidentally committed a changeset without a description and wanted to fix it. As I was pushing enter I realized that I didn't want to commit yet. I have not pushed anywhere -- an important requirement for this kind of revert.
I basically want to do a bk fix -c (if I recall my bk correctly).
Since git revert pollutes the history, it is not the right thing to do here since the bad changeset was not pushed.
But it would be the right thing to do had I pushed my change.
