Re: [RFC PATCH] push: start warning upcoming default change for push.default
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 14, 2012, 04:46 UTC
- Message-ID
- <7vbonzssap.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CAHkcotg1FKxfMR4Fe9Xfo_i4nuxzXdfVWe80HZu0wQEkiXhhmA@mail.gmail.com>
Dmitry Potapov <dpotapov@gmail.com> writes:
Show 8 quoted lines
>> One can easily get in this situation even in a kernel-style workflow: >> work from your desktop, push, work from your laptop, try to push and it >> fails. > > IMHO, when you often switch between your desktop and laptop, 'matching' > makes much more sense. If 'push' fails then usually I want to force non- > fast-forward push, because the new series contain reworked patches that > already were on the other computer.
You are free to live dangerously, but please do not teach that to other people.
Switching between two machines A and B is done a lot more safely if you arrange them to cross pull from each other, i.e. on machine A, remotes/B/* is where you keep copies of branches of B to with either of these
machineA$ git fetch B refs/heads/*:refs/remotes/B/* machineB$ git push A refs/heads/*:refs/remotes/B/*
(the latter is to emulate the former "fetch" you wish to run on A to get data from B in the reverse direction), and similarly on machine B, you use remotes/A/* to keep copies of branches of A.
That way, the risk of losing your work because the "usually" in your "then usually I want to force" turns out to be untrue is greatly reduced.