git will not submit code into a new branch of the current branch in recovery

statement:

This is a new local write some code for some reason can not enter the test state, so the code can not be submitted at this time there are new features to do. These codes how to do?
Workaround: Create a new branch, not to mention the test code into a new branch

first step:

First of all can not be submitted but still retain the code can not do commit operation
then create a local branch then modify the code will follow up

git checkout -b 新分支名     

After you create a direct switch to an existing branch can be seen on the new branch code new uncommitted appear

git checkout 新分支

May submit code can also submit code with the idea commit command tools

After submitting re-create a remote branch git input and set the track to submit code to the new branch

$ git push --set-upstream origin 新分支名(与本地分支同名)

You can view the remote branch is successfully created

git branch -a

It is possible to switch back to the original branch looking at the code, return to the previous version of the code changes.
 

 

End!

thanks for watching

 

 

Guess you like

Origin blog.csdn.net/Alice_qixin/article/details/87865242