Because sometimes there is no Internet connection locally, and then after accidentally submitting the new file code to github, the files seem to be marked as submitted the next time they are submitted (actually they are not submitted), and then the github and local codes are not Sync
No way.
My steps are usually like this
git push
git push
如果失败的话,说明网络上的版本已经更改过了,那就
git pull
如果失败的话,说明网络的版本和本地的版本在合并时可能产生冲突,那就
git stash
(把本地的修改全部缓存起来)然后再
git pull
然后再
git stash pop
(把缓存起来的修改恢复)然后如果有冲突解决冲突,没有就
git push
If it fails, it means that the version on the network has been changed, thengit pull
If it fails, it means The network version and the local version may conflict when merging, then
git stash
(cache all local changes)🎜and then 🎜git pull
🎜then Then 🎜git stash pop
(restore the cached changes)🎜Then if there is a conflict, resolve the conflict, if not, just 🎜git push
🎜 🎜Use Turtle’s Git tool under Windows. 🎜Execute as needed
How can I submit it to github without local network?
= = Is the submission you are talking about a commit?
If it is a commit, there is no problem, because the commit is to submit the code to the local warehouse
For example, when you don’t have internet
These changes are all submitted to the local repository, but the remote repository remains unchanged
wait until you have internet access
At this time, the remote warehouse will be compared with your local warehouse, and then the changes will be pushed to the remote warehouse.
The remote warehouse will also have these two commit records at this time.
'fix a bug'
'add new func'
Recommend you to read git tutorial
When there is no network, it is submitted to its own local library. If you submit to the remote library, you need to git push
If you are very sure that it is not because someone else updated that your request cannot be completed, but because the last submission caused a problem with the remote version library due to network reasons (unlikely), and you are very sure that the local library is No problem, you can:
commit is in the local warehouse and needs to be pulled up
I think so, git and github are two different concepts. I understand that you submitted it to the local version control management without an Internet connection, but did not push to the version control of the remote server. Git is distributed version control, that is, a complete version library is maintained remotely and locally. If you connect to the Internet to pull the code, you will pull the code from the server and merge it into the local branch. If you use fetch, you need to check whether you have merge remote branches.
First of all, let’s distinguish what is Git and what is Github.
Then, the Git commit will not be pushed to the remote library. Could it be that you used SVN before?