git stash - save branch working status

Temporarily work for other branches, temporarily store the working status of the current branch

Currently has two branches, masterand dev;

You devare doing your own work on Shanghai, and others need you masterto fix a bug on Shanghai. At this time, you need to temporarily record devthe work status of the branch;

command: git stash-about working status

On the devabove, execute the following command to temporarily store devthe working status of the branch

# use git stash to save current working status.
git stash

When the masterbranch finishes work and returns to the devbranch, execute

# show all working status
git stash list

# recover the lastest working status you need and delete that.
git stash pop


Do the same modification to dev

Suppose you find that after the modification on the master is completed, since dev is a continuation of the previous master, the same modification operation is required on dev. Do you need to perform the operation again?

The answer is NO (not necessary).

Git tracks changes . It provides commita command that can be copied a certain time

# cherry pick :把樱桃捡起来。是不是寓意着把某次小的提交copy过来呢
git cherry-pick <commit id>

Guess you like

Origin blog.csdn.net/qq_39378657/article/details/113110799