Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

git flow clone#165

Closed
ejholmes wants to merge 9 commits intonvie:developfrom
ejholmes:feature/git-flow-clone
Closed

git flow clone#165
ejholmes wants to merge 9 commits intonvie:developfrom
ejholmes:feature/git-flow-clone

Conversation

@ejholmes
Copy link
Copy Markdown
Contributor

This pull request may not be feature complete but I wanted to open it up for discussion.

This adds an additional subcommand to git flow for cloning repositories that use the git flow branching model. Instead of having to run multiple commands to clone and setup a repository for git flow, it would be handy to just run a single command that clones, initializes git flow, and sets up tracking for the develop and master branches.

Simply run:

git flow clone git@github.com:nvie/gitflow.git

And the repository will be cloned, git flow will get initialized, and you will be put on the develop branch.

@dillongreen
Copy link
Copy Markdown

I've done something similar yesterday, make it easy for folks to clone a repo using gitflow and start using gitflow locally as well https://github.com/markusgattol/salt/commit/8e4413064f78b85a645924c051ebd6fd113b0ebd

I think this pr should have

git config push.default tracking
git config branch.autosetuprebase always

because otherwise you will have all the merge commits from pull requests in the repos.

@ejholmes
Copy link
Copy Markdown
Contributor Author

Hmm, while I don't disagree that these are useful options, I'm not sure if I would want them included by default, mainly because they aren't included anywhere else within git-flow. But I'm open to change my mind.

@dillongreen
Copy link
Copy Markdown

using git flow clone https://github.com/saltstack/salt.git it sets up the develop branch wrong, you have to manually change

[branch "develop"]
    remote = origin
    merge = refs/heads/master

to

[branch "develop"]
    remote = origin
    merge = refs/heads/develop

in .git/config after cloning

@ejholmes
Copy link
Copy Markdown
Contributor Author

Fixed in above commit.

…mote repository doesn't already have a develop branch
@nvie
Copy link
Copy Markdown
Owner

nvie commented Nov 28, 2011

I feel your pain (I think), but I'm not sure if I like this implementation, since it is rather large and not trivial to understand for people that are used to git-flow.

Take a look at patch #167 that I've accepted this morning. Doesn't this solve the same problem in much less code and without users having to learn a new subcommand?

@ejholmes
Copy link
Copy Markdown
Contributor Author

#167 is nice. I think my only issue with it is that it still doesn't make it a one step process.

It may seem trivial to those that are already familiar with git flow, and personally, I don't have any problem with it. But if I want to get my team members up and running with git flow, it's easier for me to just have them run a single command.

Just my 2 cents. Feel free to close this pr.

@nvie
Copy link
Copy Markdown
Owner

nvie commented Feb 13, 2012

Closed by available functionality from #167.

@nvie nvie closed this Feb 13, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants