************************************************************************************************************
When using git push code to the Data warehouse, you are prompted with the following error:
... [Remote rejected] master, master (branch is currently checked out) ...
Cause of error and resolution
This is due to the server git by default rejected the push operation, need to modify the server's tortoisegit configuration file, set the system tortoisegit configuration (configuration modification level three, warehouse-level, user-level, system-level)
Method one.
- Open path: C:\ProgramData\Git
- Open the Config file config and add the following at the end:
[Receive]
Denycurrentbranch = Ignore
Method Two.
- Open Tortoisegit Settings
- Right menu find git, left screen find button ' Edit System gitconfig ', open config file, add at end
[Receive]
Denycurrentbranch = Ignore
But the problem is not over and we find that the server cannot view the files on the push after the client has successfully committed
Workaround:
Open git bash, execute the command git reset--hard so you can see the content after push
Summarize:
It's best to use git--bare init when initializing a remote repository instead of: Git init
If git init initialization is used, the directory of the remote repository also contains the work tree, and when the local repository is push to the remote repository, if the remote warehouse is on a push branch (no problem if it is not in the push branch at that time), The result of the push will not be reflected on the work tree, which is the corresponding file in the remote repository directory or the previous content.
************************************************************************************************************
Build git server under Windows Summary of various issues (i)