Git branch to solve the problem

origin:

In a branch above appeared little bug, but I'm dev branch above develop new features, but have not finished, so do not want to submit.

This is how to do it, then after reading Git tutorials and a variety of large cattle blog, Git is really feeling very good use.

The following briefly record what I do is how:

Solution:

git stash: retain the current work status, meaning that changes made to your current file (track only because git is modified files). This state is git as an unfinished state, into a stack.
When you modify the bug, and then continue to develop on the dev branch, there are two ways to solve:
first, git stash apply, with the most recent stash default, the command can also be back with the specified status code, git stash list View all stash state; the command does not delete the stash of "state", need to be manually cleared, git stash clear, the same can be specified;
second, git stash drop, after restore the original working condition and will also stash of "state" delete out, do both.

Finally, even back in the dev branch, you forget to stash inside out your original working condition, and hand cheap to change something, you can also stash show through git, view the changes you made.

Specific knowledge of the study, recommended two articles:

First: God is big Liao Git tutorial: https://www.liaoxuefeng.com/wiki/896043488029600/900388704535136
Second: write personally think is better, always place a blog: HTTPS: // the WWW. cnblogs.com/tocy/p/git-stash-reference.html

These two articles, we have basically covered the essence of this knowledge, but also for the future development of the project team do, the branch management is very helpful.

 

Guess you like

Origin www.cnblogs.com/Archie2018/p/12505443.html