Re: "groups of files" in Git?
- From
- Igor Djordjevic <igor.d.djordjevic@gmail.com>
- Date
- Jul 13, 2017, 23:32 UTC
- Message-ID
- <40292f8e-e8a9-8b7a-112f-ef4b183a6b35@gmail.com>
- In-Reply-To
- <27a3c650-5843-d446-1f59-64fabe5434a3@gmail.com>
Just a small update/fixup:
On 14/07/2017 00:39, Igor Djordjevic wrote:
Show 9 quoted lines
> I guess it would be a kind of alias to doing: > > $ git checkout featureA > $ git add ... > $ git commit > $ git checkout master > $ git reset --hard HEAD^ > $ git merge featureA featureB >
This should, in fact, be:
$ git checkout featureA
$ git commit
$ git checkout master
$ git reset --hard HEAD^
$ git merge <HEAD@{1} parents>
(removed "git add" step, as that is needed for proposed single step
solution as well, as a usual step preceding the commit; also replaced
concrete branch names in the last step with a more generic
description, better communicating real intent)Show 10 quoted lines
> In the same manner, it should be possible to drop a commit from the > feature branch in a single step, for example returning to the state > as shown in (1), or even "port" it from one branch to the other, like > this (without a need for it to be the last commit, even): > > (3) o---o---o---\ (featureA) > / \ > ---o---o---o-------M' (master, HEAD) > \ / > o---o---A'--o (featureB)
Here, the diagram should look like this:
(3) o---o---o---\ (featureA)
/ \
---o---o---o-------M'' (master, HEAD)
\ /
o---o---A''-o (featureB)(replaced leftover M' from the previous diagram with M'' to show it`s yet another (updated) merge commit, different from both M and M' in terms of SHA1, yet the contents would probably, but not necessarily, be the same for all three; same for leftover A', replaced with A'')
Regards, Buga