84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
比防说我在11点00分从服务器拉取了一次代码,然后与我本地的合并完并且提交了,在11点01分时准备push的时候,提示在我push之前已经有其他人抢险push了,我需要再pull一下才能提交,这时我是否需要将我本地的这一次commit回滚掉?
如果需要回滚我本地的commit该怎么回滚呢?
我现在的做法就是 git reset --hard commitid,这样貌似就把我提交的文件移出暂存区了?我这么做是否正确呢?是否还有其他做法呢?
Should we pull again?If there is a conflict, resolve the conflict and then commit and pushIf there is no conflict, commit and push directly
After git pull down,
If there is a conflict, resolve the conflict before committing, and then push;
If there is no conflict, you can push directly
After you pull from the server, you actually merge the previous rescue push into your own local version. There are two results:
Automatic merge successful (fast-forward)
Automatic merge failed, manual merge is required
In both cases, you should re-run test to ensure that the merged code does not affect your original functions and ideas. Then push.
git fetch origin && git rebase origin/master && git push
Should we pull again?
If there is a conflict, resolve the conflict and then commit and push
If there is no conflict, commit and push directly
After git pull down,
If there is a conflict, resolve the conflict before committing, and then push;
If there is no conflict, you can push directly
After you pull from the server, you actually merge the previous rescue push into your own local version. There are two results:
Automatic merge successful (fast-forward)
Automatic merge failed, manual merge is required
In both cases, you should re-run test to ensure that the merged code does not affect your original functions and ideas. Then push.
git fetch origin && git rebase origin/master && git push