gpt4 book ai didi

git - 为什么我不必在 git merge 之后提交

转载 作者:太空狗 更新时间:2023-10-29 12:50:26 24 4
gpt4 key购买 nike

我有一个 repo master,我使用 file1.txt 和 file2.txt

git checkout -b fix1

然后我更改 file1.txt

然后我做了一个

git commit -a

然后我做一个

git checkout master

然后我做一个

git checkout -b fix2

然后我更改 file2.txt

然后我做了一个

git commit -a

然后 git checkout master然后一个

git merge fix1
git marge fix2

但是如果我做一个

 commit -a 

我明白了

# On branch masternothing to commit (working directory clean)

最佳答案

git merge 自动提交。如果您不想提交,请添加 --no-commit 参数:

  --commit, --no-commit
Perform the merge and commit the result. This option can be used to override --no-commit.

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.

关于git - 为什么我不必在 git merge 之后提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14835981/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com