Hello,

you can tell git-clone which branch to check out with the -b option. See
the git-clone man page for details.

Also, this kind of alias seems to be a good candidate for a shell script;
if you name it git-gettfm, mark it as executable and put it somewhere in
the PATH (recent Linux distros have ~/bin in $PATH), it will work like your
alias, with a bit less overhead.

Or, if you don't want to go with that, you can shorten your gettf1-4 lines
to something like

gettf1 = "clone ssh://myu...@git.domain.com/scm/banadmpg/base.git"

Bes,
Gergely
On Feb 22, 2016 3:17 AM, "Duane Rosengartner" <duane5...@gmail.com> wrote:

I have an alias which sequentially clones a set of projects, such as base,
common, general, and student. Code below is set in my global gitconfig.
This works fine for me, cloning into whichever directory I may be executing
from, but when my colleague executes the same script on windows 7, the
cloned projects are written to his c:\ directory.  Does anyone see a means
to remedy this with a tweek to this gitconfig or another git setting which
may be contributing to the issue?

[alias]
co = !sh -c 'git checkout'
gettf1 = !sh -c 'git clone
https://myu...@git.domain.com/scm/banadmpg/base.git'
gettf2 = !sh -c 'git clone
https://myu...@git.domain.com/scm/banadmpg/common.git'
gettf3 = !sh -c 'git clone
https://myu...@git.domain.com/scm/banadmpg/general.git'
gettf4 = !sh -c 'git clone
https://myu...@git.domain.com/scm/banadmpg/student.git'
gettfm = !sh -c 'git gettf1 && git gettf2 && git gettf3 && git gettf4'

usage: c:\myproject> git gettfm
writes all projects to myproject directory where executed

Also, what I really set out to do was clone and checkout specific branches.
Currently, I use a separate FOR from cmd-line which says: for projects 1 &
3 checkout myDevBranch. If anyone has a slick clone/checkout script with
conditional logic for project name I would be most grateful.

Thanks in advance
Duane

-- 
You received this message because you are subscribed to the Google Groups
"Git for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to