Re: Difficulties in advertising a new branch to git newbies

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: sbejar
Date: Thursday, February 1, 2007 - 2:02 am

On 2/1/07, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:

Maybe, I'm not sure.


You can do it with git-remote. I think it is sensible to have a
command to get a new repository and a command to have a new remote.

For the "work on the non-HEAD branch" I think we could have:

# clone a remote repository and start working with branch ${branch}
$ git clone -b ${branch} ${url}

# add a new branch based on a remote branch,
# and configure to pull from there.
$ git branch ${branch} ${remote_branch}
$ git checkout -b ${branch} ${remote_branch}

as you see it is the current syntax, so I suggest to automatically
setup the branch.${branch}.{remote,merge} configs to follow the
${remote_branch} if this is sensible. So for example

$ git clone ${url_of_git.git}
$ cd git
$ git checkout -b maint origin/maint
$ git-config -l | grep ^branch.maint
branch.master.remote=origin
branch.master.merge=refs/heads/maint

( or branch.master.merge=refs/remotes/origin/maint )

This changes the current behaviour, but I think it make sense. If this
is not possible another way would be to have another option (-r for
remote, or -f for follow, or -p for pull, or -m for merge, ...) as:

$ git branch ${branch} -r ${remote_branch}
$ git checkout -b ${branch} -r ${remote_branch}

And if you want to add/change the remote/merge config for an existing
branch, in addition to doing this with git-config, git-remote could do
it as it currently shows the tracking branches.

Santi
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Difficulties in advertising a new branch to git newbies, Matthias Lederhofer, (Tue Jan 30, 3:33 pm)
Re: Difficulties in advertising a new branch to git newbies, Matthias Lederhofer, (Tue Jan 30, 3:36 pm)
Re: Difficulties in advertising a new branch to git newbies, Daniel Barkalow, (Tue Jan 30, 5:10 pm)
Re: Difficulties in advertising a new branch to git newbies, Daniel Barkalow, (Tue Jan 30, 10:09 pm)
Re: Difficulties in advertising a new branch to git newbies, Guilhem Bonnefille, (Wed Jan 31, 6:13 am)
Re: Difficulties in advertising a new branch to git newbies, J. Bruce Fields, (Wed Jan 31, 7:38 am)
Re: Difficulties in advertising a new branch to git newbies, Johannes Schindelin, (Wed Jan 31, 9:15 am)
Re: Difficulties in advertising a new branch to git newbies, Daniel Barkalow, (Wed Jan 31, 9:25 am)
Re: Difficulties in advertising a new branch to git newbies, Josef Weidendorfer, (Wed Jan 31, 5:20 pm)
Re: Difficulties in advertising a new branch to git newbies, sbejar, (Thu Feb 1, 2:02 am)