Recently learned Git rebase, feel very cool appearance,
It turned out to be a slap in the face today.
Git pull--rebase
Error:
Cannot rebase:you have unstaged changes please
commit or stash them.
The first reaction is:
No. Can Yes. Just now it was clearly submitted. How can there be changes. Hysterical.
Finally with git status a look:
。。。。
I was wrong... Take a call and forget about the deletion of the file--. Summary: 1.git pull–rebase Understanding
This command does the following:
A. Take the contents of your commit to the local warehouse and remove it to the registers (stash) (at which point your workspace is clean)
B. Then from the remote pull the replacement code to the local, because the workspace is clean, so there will be no conflict
C. Remove from registers the content you submitted before and merge with the code you pulled down.
So rebase make sure your local workspace is clean before pulling the code, and if your locally modified content is not fully commit or stash, you will rebase fail. 2. Or to listen to Git tips, to be sensible, what is not clear, input
git status
According to the person's prompt, the submitted submission, stash the stash. 3. After deleting files, you need git add-a, just git Add. No, the difference is as follows:
Several parameter differences for git add
Git add-a Save all the changes
git Add. Save new additions and modifications, but do not include deletion
Git add-u saves changes and deletes, but does not include new files.