How to setup branch tracking when starting local?
brian at microcomaustralia.com.au
Tue Feb 7 23:40:12 CET 2012
On 7 February 2012 21:41, Thomas Koch <thomas at koch.ro> wrote:
> 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 ---
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 microcomaustralia.com.au>
More information about the vcs-home