Git collaborative work-non-fast forward push
Non-fast-forwardupdates is pushed when the content of the remote version Library and the current version library is inconsistent. This is generally caused by multi-member collaboration, other users pushed to the remote version library between the previous commit and the current commit.
Non-fast forward push logs:
Figure 1
This is the commit hash value for the remote and current version libraries.
Go to the. git directory to view the latest commit information of the local version Library:
Figure 2
View the remote version library commit information:
Figure 3
We can see that there is a difference between the two, that is, "non-fast forward push ".
Solution:
- Force push.
Use gitpush origin master -- force or gitpush origin master-f.
However, this method may overwrite other people's submissions. It can be used when it is determined that it will not affect others' submissions, such as using gitcommit-amend to modify the submission log.
- Execute pull and continue Push, that is, merge and Push. This is how multi-member collaborative recommendation works.
Gitpull
Gitpush origin master
Others
Of course, in the team collaboration management, non-fast forward push can also be disabled. You can use the receive. denyNonFastForwards variable or the hook script to set it.
Install Git on Ubuntu Server
Create a Git repository on the server (Ubuntu)
Git simple tutorial in Linux (taking Android as an example)
Git authoritative guide PDF
Git details: click here
Git: click here
This article permanently updates the link address: