Sourcetree cannot push branch to distal

Source: Internet
Author: User
Tags sourcetree

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.

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.