Sourcetree cannot push branch to the far end, prompting refusing to update checked out branch error, git operation no problem, what's going on?
This is because GIT init is used when building a local Git code base, and if you use GIT init initialization, the remote warehouse directory contains work tree, and when the local warehouse is pushed to the remote warehouse, If the remote repository is on a push branch (no problem if it is not in the push branch at the time), then the result of the push does not respond to the work tree, or the corresponding file or previous content in the directory at the remote warehouse.
The solution now is:
Locate the local Git warehouse folder, enter the. git folder (Show hidden files and folders), open config file editing, and add the following code:
Denycurrentbranch = Ignore
It's OK to push the remote.
What are the specific differences between git init and git--bare init?
General personal use, with Git init, this time your work area is also here. If you want to set up a fixed address for everyone to use, just use Git--bare init on the server.
In fact, you can see that Init created a. Git directory content that is similar to the directory content created by--bare.