GIT common settings and problems encountered in configuration

 

There are two modes of git initialization, one is git init, which records the version submitted by the current library and displays the project file, and the other is git init --bare, which is called a bare warehouse. The current warehouse cannot be submitted because it is not Contains project files and only version libraries, so this mode is mostly used in the core warehouse of remote warehouses (much like the central warehouse in SVN)

If the remote library is a git init library, the 'receive.denyCurrentBranch' Configuration variable to 'refuse' will be prompted when pushing to the remote library for the first time, that is, refusing to merge into the current branch. The following configuration is required: git config receive.denyCurrentBranch =ignore can be. After the push is successful, you also need to execute git reset --hard in the remote library, and roll back to the latest commit history to display the latest commit

Therefore, it is strongly recommended to use git init --bare to set up a central remote library first, and then pull from the central remote library

 

In addition, the push failure is likely to be a permission problem. The git user does not have permission to create a directory, so it needs to be authorized on the server, either modifying the owner or group, or modifying the permissions

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325985766&siteId=291194637