Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Stupid question on getting branch from yesterday

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:54

Linus Torvalds [off-list ref] writes:
So depending on what your situation is, this sequence actually works:

	#
	# Create and check out a "fixes" branch that has the 
	# known-broken commit as its head commit
	#
	git checkout -b fixes <BROKEN-COMMIT>

	.. edit edit edit to fix the broken commit ..

	#
	# Then, just _replace_ the broken commit with the fixed state
	# by doing a "git commit --amend"
	#
	git commit -a --amend

	#
	# ok, now the "fixed-branch" is in good shape, but we
	# want to re-surrect our original 'master' branch WITH the 
	# fix, and based on the fixed branch, so we rebase the
	# master branch# _onto_ the fixed state in "fixes", with
	# the broken commit (that we do _not_ want to include) as
	# the base.
	#
	git rebase --onto fixes <BROKEN-COMMIT> master

Somebody else should verify that "git rebase" thing.
Looks fine.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help