E 'possibile fare un "git merge", ma senza un commit?git unione senza auto commit
"man git merge", dice questo:
With --no-commit perform the merge but pretend the merge failed and do not autocommit,
to give the user a chance to inspect and further tweak the merge result before
committing.
Ma quando provo ad usare git fondersi con il --no-commit ancora auto-commit. Ecco quello che ho fatto:
$> ~/git/testrepo$ git checkout master
Switched to branch 'master'
$> ~/git/testrepo$ git branch
* master
v1.0
$> ~/git/testrepo$ git merge --no-commit v1.0
Updating c0c9fd2..18fa02c
Fast-forward
file1 | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
$> ~/git/testrepo$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
Un successivo "git log" rivela tutti i commit dal ramo v1.0 fuse in master.
cosa succede se c'è un confitto. – Michelle
@PineappleUndertheSea I forward veloci non causano mai conflitti. In caso di unione "reale" senza avanzamento veloce, l'opzione '--no-commit' è efficace solo se non si verifica alcun conflitto, in caso di conflitto git non effettuerà mai il commit automatico. – gronostaj
FYI: Se vuoi unire le modifiche e poi commettere _as se avevi digitato manualmente tutte le modifiche che hai unito in_ (al contrario di un'unione tradizionale) devi eseguire 'rm.git/MERGE_HEAD' dopo, che costringerà git a dimenticare che l'unione è avvenuta. – Jonn