Newbie Question: Cloning a git flow repo and pulling down published branch

941 views
Skip to first unread message

deathgaze

unread,
Sep 17, 2013, 5:25:31 PM9/17/13
to gitflo...@googlegroups.com
First, please forgive this post. I am very new to git and git flow and there are many things about this whole package that I don't know about or don't know how to find the answers to. I don't know where the gaps in my knowledge are and, thus, have no idea what I'm looking for. 

What's the workflow for cloning an existing repo and pulling down changes? 

Say for example I have some repo 'foo'

foo has the following branches
master
develop
feature/foo
feature/bar

I clone the repo...
git clone <prefix>/user/foo

and now I have a bare repository with just the head branch checked out (I think). What's the proper procedure to turn on git flow? Since git flow config info isn't stored on the server, git flow repos have to be initialized. But if I just run git flow init, I run into problems since there's no master branch and no develop branch or any of the other branches. So what do I do? What's the proper workflow here?

I see on the git flow cheat sheet that all I need to do to get a feature branch is git flow feature pull <featurename>. I was under the impression that was all that was needed for a cloned repo to come up to speed was to git flow init and then git flow feature pull <featurename> but apparently there's a LOT more to it than that. Can anyone fill me in on the details? How would I go about, say, pulling down feature/foo from a freshly cloned repo?

Hartmut Goebel

unread,
Sep 18, 2013, 5:59:12 PM9/18/13
to gitflo...@googlegroups.com
Am 17.09.2013 23:25, schrieb deathgaze:
foo has the following branches
master
develop
feature/foo
feature/bar

I clone the repo...
git clone <prefix>/user/foo

Just to be sure we are talking about the same situation: You did something like

cd /tmp
git clone  <prefix>/user/foo
cd /tmp/foo



and now I have a bare repository with just the head branch checked out (I think).

I'm not a git-guru either. But I doubt your cloned repo is a "bare" repository, since AFAIK a "bare" repo does not have any branch checked out. You can simply check the state of your cloned repo with "git status" and "git branch". I also suggest using "gitk --all" to get a visual impression of your cloned repo. This also shows which branches are available.

git branch -r should give you
origin/master
origin/develop
origin/feature/foo
origin/feature/bar
origin/HEAD -> origin/develop    # my be different



What's the proper procedure to turn on git flow?

Just run "git flow init -d". This works fine at least when using the  git-flow Python Edition (https://github.com/htgoebel/gitflow).


-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.go...@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |
Reply all
Reply to author
Forward
0 new messages