Build git server under Windows Summary of various issues (i)

Source: Internet
Author: User
Tags using git

************************************************************************************************************

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.

    1. Open path: C:\ProgramData\Git
    2. Open the Config file config and add the following at the end:

[Receive]
Denycurrentbranch = Ignore

Method Two.

    1. Open Tortoisegit Settings
    2. 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.