Re: [PATCH] git push --track

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> 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 ...

> 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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]