Solve the tortoisegit strange bad file number problem

Source: Internet
Author: User

This issue, please do not use rebase, download the latest tortoisegit can;

TortoiseGit-2.3 Chinese version and git install package _ Manual: http://download.csdn.net/detail/renfufei/9738152 Problem Description

Yesterday, and today (2014-11-29), the use of tortoisegit encountered a strange problem. Uninstall, clean up the registry, reload, restart, after a variety of tossing, or can not be resolved. But after 23.45 minutes, suddenly a flash of light, solved.

The problem is this. git push with the command line, git fetch, git pull, whatever. However, when you use Tortoisegit to execute a pull ... command, an error message is given as follows:

Git.exe pull-v--no-rebase--progress "origin"

/libexec/git-core/git-sh-setup:line:/bin/sed:bad file Number
  from https://github.com/cncounter/translation
= [up to date]      master,     origin/master
d:\ Develop\git/libexec/git-core\git-pull:line 268:/bin/tr:bad file Number
Your configuration specifies to merge with T He ref ' master ' from
the remote, but no such ref was fetched.


Git failed to end successfully (exit code 1) (3510 ms @ 2014/11/29 23:51:56)

Dead and alive various toss, according to the hint, said: Your configuration specified to go to merge (merge) The far end of the ' master ', but did not get (fetch) to this reference (ref).

Then various tests, various toss, finally found a little law. If the GitHub online repository has only one branch, that is master, pull pulls will not error, if the online remote repository has multiple branches, such as Master plus gh-pages, a pull to report this error. But using the git command line does not have this problem. So the problem is, it must be tortoisegit where the configuration is wrong.

Want to think about it, suddenly want to modify the configuration file in the local warehouse, first look at the error of this configuration:

[Core]
    repositoryformatversion = 0
    FileMode = False
    bare = False
    Logallrefupdates = True
    symlinks = False
    IgnoreCase = True
    hidedotfiles = dotgitonly
[remote "origin"]
    URL = https://github.com/cncounter/ Translation.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    Remote = Origin
    Merge = Refs/heads/master
[remote]
    Pushdefault = Origin
[credential]
    helper = Store
To View the method:Open the GIT project root directory, locate the. git folder, go inside to edit the config file, and note that the file does not have a suffix. You can also open this file by right-clicking on the project root, choosing Tortoisegit-Settings (set S), and then selecting the Git-to-right edit local button on the left-hand side. Git/config, as shown in the following image:

So, what are the log outputs of a normal pull fetch operation?

Git.exe pull-v--no-rebase--progress "origin" master from

https://github.com/renfufei/asynquence
* Branch            Master-     fetch_head
= [up to date]      master,     Origin/master
already up-to-date.

Success (5959 ms @ 2014/11/30 0:11:27)

A comparison finds the first line of Git pull ..... A master is missing from the last face. So think about adding this master to the config file to see if it's OK.

The modified configuration is as follows:

[Core]
    repositoryformatversion = 0
    FileMode = False
    bare = False
    Logallrefupdates = True
    symlinks = False
    IgnoreCase = True
    hidedotfiles = dotgitonly
[remote "origin"]
    URL = https://github.com/cncounter/ Translation.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    Remote = Origin Master
    merge = Refs/heads/master
[Remote]
    Pushdefault = Origin
[credential]
    helper = Store

It is important to note that because there are multiple branches at the far end, there is a corresponding section [branch "master"] in this configuration file, and the following remote = Origion in this section, now plus master becomes:

    [branch "master"]
    Remote = origin Master
    merge = Refs/heads/master 

As shown in the following illustration:

Save, test again, OK, can pull normally:

Git.exe pull-v--no-rebase--progress "origin" master from

https://github.com/cncounter/translation
* branch< C6/>master     -Fetch_head
= [up to date]      master,     Origin/master
already up-to-date.

Success (2246 ms @ 2014/11/30 0:19:25)

Notice that in the first line Git.exe pull .... There is a master in the back:

Well, the problem is solved perfectly. [This may be a BUG in the current version of Tortoisegit] Summary

Some days, is not suitable for writing code, nor suitable for the adjustment program, but suitable for pits, perhaps the pit filled more, time a turn, the problem solved. Additional Information

The problem should be that specific versions of Git are not compatible with Tortoisegit. The version information I use is:

Tortoisegit 1.8.12.0 (D:\Develop\TortoiseGit\bin\)
git version 1.9.4.msysgit.2 (D:\Develop\Git\bin)

This is going to be a problem. It doesn't matter how much it's branching.

The git version of my office computer seems to be 1.9.2 or something, it's not 1.9.4, there's no problem, and there's no need for special handling.

Specific software that you can download here:

http://download.csdn.net/detail/renfufei/9738152 related articles

Directory Installation and configuration git installation and configuration tortoisegit git and tortoisegit basic Operations markdown Example resolution Tortoisegit weird bad file number problem join QQ Group GitHub home: 225932282

Date: 2014-11-27

Author:  anchor: Http://blog.csdn.net/renfufei

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.