Do show the top-level working dir.
[git-shortcuts.git] / git-pass
blobeaa3beb4178d17e64b623ccb8a01a10ea2ac364e
1 #!/bin/sh
3 # It merely prints a series of refspecs made by reduplicating the given refs (treating the prefix + specially).
4 # But it's a quite useful thing! See the usage below.
6 for ref in "$@"; do
7 echo "$ref:${ref#+}"
8 done
10 # Use it like this:
12 # [imz@etik git-shortcuts]$ git pass +refs/remotes/@gitorious/* | xargs git push origin -v
13 # Pushing to /media/disk/my/code/git-shortcuts/.git
14 # Total 0 (delta 0), reused 0 (delta 0)
15 # To /media/disk/my/code/git-shortcuts/.git
16 # * [new branch] @gitorious/master -> @gitorious/master
17 # [imz@etik git-shortcuts]$ git pass +refs/remotes/@{dell,vaio}/* | xargs git fetch origin -v
18 # From /media/disk/my/code/git-shortcuts/
19 # * [new branch] @dell/master -> @dell/master
20 # * [new branch] @vaio/master -> @vaio/master
21 # [imz@etik git-shortcuts]$ git pass +refs/remotes/@{dell,vaio}/* | xargs git push @gitorious -v
22 # Pushing to git@gitorious.org:git-shortcuts/mainline.git
23 # Enter passphrase for key '/home/imz/.ssh/id_rsa':
24 # Total 0 (delta 0), reused 0 (delta 0)
25 # To git@gitorious.org:git-shortcuts/mainline.git
26 # * [new branch] @dell/master -> @dell/master
27 # * [new branch] @vaio/master -> @vaio/master
28 # => Syncing Gitorious... [OK]
29 # [imz@etik git-shortcuts]$
31 # Alternatively to using this command and in order to save even more typing, you could set up the refspecs in the config, like this:
33 # [remote "origin"]
34 # url = /mnt/usbmem1/my/code/git-shortcuts/.git
35 # fetch = +refs/heads/*:refs/remotes/origin/*
36 # fetch = +refs/remotes/@dell/*:refs/remotes/@dell/*
37 # fetch = +refs/remotes/@vaio/*:refs/remotes/@vaio/*
38 # push = refs/heads/*:refs/heads/*
39 # push = +refs/remotes/@gitorious/*:refs/remotes/@gitorious/*
41 # Warning: multiple "push = " lines seem not to work in git-1.5.5.5-alt1, should try putting it to .git/remotes/... .