Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [RFC PATCH] push: start warning upcoming default change for push.default

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:18

Dmitry Potapov [off-list ref] writes:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help