Re: [PATCH] git push --track
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jan 15, 2010, 13:26 UTC
- Message-ID
- <vpq3a277b39.fsf@bauges.imag.fr>
- In-Reply-To
- <7vr5ps5jx1.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> The small nit is that "branch -f --track me origin/me" will happily > overwrite "me", even when your "me" is not up to date with "origin/me", > losing commits.
And another issue is:
$ git branch -f --track my-branch origin/my-branch fatal: Cannot force update the current branch. $ git branch --track my-branch origin/my-branch fatal: A branch named 'my-branch' already exists.
Actually, I just can't find a natural set of commands doing:
1. create a branch (git checkout -b) 2. work on it 3. send it upstream (git push) 4. set the upstream as tracking (???)
with the current version of Git. I just do 4. with $EDITOR .git/config ...
Show 5 quoted lines
> Perhaps we could teach "branch --track me origin/me" (i.e. no "-f") not to > barf even when "me" exists, as long as "me" is a subset of "origin/me", > and treat it as a request to re-configure the upstream information for the > existing branch "me" and at the same time fast-forward it to > "origin/me"?
+1, and in addition, allow doing this on the checkout branch if it doesn't actually change the reference (i.e. touch .git/config, not .git/refs/...).
-- Matthieu Moy http://www-verimag.imag.fr/~moy/