我在我的电脑上编写代码,并拥有几个计算节点。
为了保持我的程序同步,我决定使用git。以前,我使用它的单向模式将更改从PC“推下”到计算节点。然而,不时会遇到一些与计算节点特定的小错误,并在现场进行修复。这比在PC上编写并提交可能或可能未修复所有问题的更改要容易测试和开发。
我决定使用git实用程序将更改发送回“主”代码库。
我编写了一个修复程序。在计算笔记本上提交了它,使用git format-patch origin
。将补丁发送到我的电脑并使用git am
应用它。到此为止,一切看起来都很好。
但是,在计算节点上使用git pull
时,它再次从origin拉出带有补丁的提交,并且git log
显示具有相同注释和作者的两个提交。
我使用的命令有误,还是我的工作流程有缺陷?或者这是可以接受的?(但是我觉得这不好看)。
我在两种情况下都使用master
分支。
git pull
计算节点:
commit 68710f82ddb2b2f191a9c29f088423853032a851 <--- git pull enforced merge
Merge: ce19df4 609b82b
Author: luk32 <luk32@computing.node>
Date: Fri Dec 13 20:39:28 2013 +0100
Merge branch 'master' of PC:~/projects/_cmake
commit 609b82bc96f88da956869cec2953e8621cbdcd93 <--- 2nd git pull after git am
Author: luk32 <luk32@computing.node>
Date: Fri Dec 13 20:35:23 2013 +0100
Changed to worki with MathGL version 2. Broken version 1 compatibility!
commit ce19df4760519eaf42269461f7bdcf94b65bdc48 <--- on-site fix
Author: luk32 <luk32@computing.node>
Date: Fri Dec 13 20:35:23 2013 +0100
Changed to worki with MathGL version 2. Broken version 1 compatibility!
commit ccc5b8a1854e4ca4089cf4c0945baff990288557 <--- after previous git pull
Author: lukas <luk32@PC>
Date: Mon Jan 16 10:33:11 2012 +0100
skeleton changed to introduce project stacks
在电脑上运行
git log
命令看起来很好:commit 609b82bc96f88da956869cec2953e8621cbdcd93
Author: luk32 <luk32@computring.node>
Date: Fri Dec 13 20:35:23 2013 +0100
Changed to worki with MathGL version 2. Broken version 1 compatibility!
commit ccc5b8a1854e4ca4089cf4c0945baff990288557
Author: lukasz kucharski <luk32@PC>
Date: Mon Jan 16 10:33:11 2012 +0100
skeleton changed to introduce project stacks
编辑:
计算.节点: 〜/项目/_cmake$ git log --装饰--图形--单行主人
* 68710f8 (HEAD, master) Merge branch 'master' of PC:~/projects/_cmake
|\
| * 609b82b (origin/master, origin/HEAD) Changed to work with MathGL version 2. Broken version 1 compatibility!
| * ccc5b8a skeleton changed to introduce project stacks
* | ce19df4 Changed to work with MathGL version 2. Broken version 1 compatibility!
|/
* 35d2eaa (origin/pushee) added eigen3 find module
* 39f4937 small bugfixes and slight changes in the reporting of what's going on
git log --decorate --graph --oneline master
相关部分。 - Peter Lundgren