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

Re: GIT version


Am 08.02.25 um 11:09 schrieb BB:
On 8/2/25 7:54 pm, Christof Thalhofer wrote:
The 'staging area' with its possibility to select and collect a couple
of changes to compose a commit. The 'stash' that can be used to set
aside all changes to forget them or reapply them later. I did not test
if it can be used to create branches and if it would be possible to
cherry-pick from another branch into the current one.

Yes, I start to see.

That is one of the reasons I use external tools (like qgit) where I can
do "partial" commits of the current working set (or staged changes as
you call them).

The stage is there to collect specific changes and commit them afterwards. Staging is done by 'git add'.

https://github.com/git-guides/git-add

As for the cherry picking copy issue, I dont think that is possible
(with ease).

A ----> B ------------->

                    \   pick some of

                      \ B and merge it back into A

A -----> A' ---------------->

There may be a way to do this with git itself but frankly it looks like
a recipe for madness 😕

Cherry picking is very easy.

Assume you are in a feature branch (featurex) which was created from master. And then you change something that should also be in master. But not the rest of your work in featurex.

Just commit this special change:
'git add filewithmyspecialchange'
'git comit -m "my special change"

Remember the hash of that commit.

Switch to master: 'git checkout master'
Then do 'git cherry-pick $hash'
Now this commit is also part of master.
Switch back to featurex: 'git checkout featurex'

And you're done. Thanks to finely granulated commits.

It was madness in SVN.

Alles Gute

Christof Thalhofer

--
Dies ist keine Signatur


References:
GIT versionPhilippe Valarcher <philippe.valarcher@xxxxxxx>
Re: GIT versionBruce Steers <bsteers4@xxxxxxxxx>
Re: GIT versionPhilippe Valarcher <philippe.valarcher@xxxxxxx>
Re: GIT versiongbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: GIT versionPhilippe Valarcher <philippe.valarcher@xxxxxxx>
Re: GIT versionBruce Steers <bsteers4@xxxxxxxxx>
Re: GIT versionBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: GIT versionChristof Thalhofer <chrisml@xxxxxxxxxxx>
Re: GIT versionChristof Thalhofer <chrisml@xxxxxxxxxxx>
Re: GIT versionBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: GIT versionChristof Thalhofer <chrisml@xxxxxxxxxxx>
Re: GIT versionBB <adamnt42@xxxxxxxxx>
Re: GIT versionChristof Thalhofer <chrisml@xxxxxxxxxxx>
Re: GIT versionBB <adamnt42@xxxxxxxxx>