After git pull, the newly updated local files are deleted
淡淡烟草味
淡淡烟草味 2017-05-02 09:39:13
0
2
811

There are 4 files in the remote warehouse and 5 files in the local warehouse, which is equivalent to adding one new file. After git pulling it from the remote warehouse, the new local files will be deleted. Direct git push will prompt that the version is behind. Can't push to remote warehouse, what should I do?

淡淡烟草味
淡淡烟草味

reply all(2)
我想大声告诉你

Commit the newly added local files first and then merge the remote repository. The specific operations are as follows:
git add .
git commit -m "something"
git fetch
git rebase -i origin/remote branch name
You can use rebase Prevent split ends

PHPzhong

Just to add. If it is not the final version submitted yet, there are two options at the git commit step.

One is to stash first and then rebase git stash apply stash@{0}
也可以先commit,然后完成了所有本地更改之后再git commit --amend

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template