The company submitted git remote

New start with git, almost crashes out, always conflict

The following operations are carried out in my local master branch

Save 0. First copy the code to a local

1. git stash // modify the current cache

2. git pull origin master // pull remote master branch main content

3. git stash pop // release the modified contents

4. git push origin HEAD: * temp / New Remote branch and submit the code, modify the completion of the merger will be led

These are the normal procedure, but I practice very easy to go wrong, 1. Master version change frequently, 2. people modify the same file cause conflicts

Every time I would commit (to prevent loss of the code, but the post-conflict still do not understand how to get back), my version will lead to the master branch and remote version conflict, then the error will be executed after the pull command before git stash (REBASE | master) ,

At this point I will execute git rebase --skip cancel commit (canceled repeatedly submitted multiple times, until no conflict), then pull, then I will direct the zeroth save the code coverage to copy my code

(You can also execute git stash pop, you can also go inside the code idea modify records inside all of a recovery, but it feels too much code modification, error-prone), and then perform Step Four

Resolve conflicts codes, in which git idea inside, select conflict resolution options, and then manually code will need to merge

 

Guess you like

Origin www.cnblogs.com/xiaolbk/p/12004644.html