How to setup branch tracking when starting local?

Brian May brian at
Tue Feb 7 23:40:12 CET 2012

On 7 February 2012 21:41, Thomas Koch <thomas at> wrote:

> #!/bin/sh
> vcsh $1 remote add origin $VCSH_REMOTE_BASE/$1.git


vcsh run "$1" remote git add origin "$VCSH_REMOTE_BASE/$1.git"
vcsh run "$1" remote git push origin master

Note that I wouldn't personally use the shortcuts inside a script -
just in the unlikely case you ever have a repository name that
conflicts with a vcsh command.

Also note that this won't work unless there is something to push.

My script I created to add a new repository looks like (note: I use
unison to sync ~/tree between computers).

--- cut ---
set -ex


git init --bare "$HOME/tree/vcsh.repos/$NAME"

vcsh init "$NAME"
vcsh run "$NAME" git remote add origin "~/tree/vcsh.repos/$NAME"

cat << EOF > "$HOME/.config/mr/available.d/$NAME.vcsh"
checkout = vcsh clone ~/tree/vcsh.repos/$NAME $NAME

ln -s "../available.d/$NAME.vcsh" "$HOME/.config/mr/config.d"
--- cut ---

This doesn't do the initial push however, because this needs a commit
to work. At least it does make things a bit easier then doing
everything by hand.
Brian May <brian at>

More information about the vcs-home mailing list