Solve the tortoisegit strange bad file number problem

Source: Internet
Author: User

http://blog.csdn.net/renfufei/article/details/41648061

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. Using the command linegit push,git fetch,git pullThere's nothing wrong with anything. However, when you use Tortoisegit to execute a pull ... command, an error message is given as follows:

[Plain]View Plaincopy
  1. Git.exe pull-v--no-rebase--progress "origin"
  2. /libexec/git-core/git-sh-setup:line:/bin/sed:bad File Number
  3. From Https://github.com/cncounter/translation
  4. = [up to date] master, Origin/master
  5. D:\develop\git/libexec/git-core\git-pull:line 268:/bin/tr:bad File Number
  6. Your configuration Specifies to merge with the ref ' master '
  7. From the remote, but no such ref was fetched.
  8. 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 asmasterPlusgh-pages, a pull will report the mistake. 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:

[Plain]View Plaincopy
  1. [Core]
  2. repositoryformatversion = 0
  3. FileMode = False
  4. Bare = False
  5. Logallrefupdates = True
  6. Symlinks = False
  7. IgnoreCase = True
  8. Hidedotfiles = dotgitonly
  9. [remote "origin"]
  10. URL = https://github.com/cncounter/translation.git
  11. Fetch = +refs/heads/*:refs/remotes/origin/*
  12. [branch "master"]
  13. Remote = origin
  14. Merge = Refs/heads/master
  15. [Remote]
  16. Pushdefault = Origin
  17. [Credential]
  18. Helper = Store


To view the method:
    • Open the Git project root directory, find the. git folder, go inside edit  config   This file, note that this file does not have a suffix.
    • edit the local .git/config  button to open the file as shown in:

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

[Plain]View Plaincopy
    1. Git.exe pull-v--no-rebase--progress "origin" master
    2. From Https://github.com/renfufei/asynquence
    3. * Branch Master--Fetch_head
    4. = [up to date] master, Origin/master
    5. Already up-to-date.
    6. 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:

[Plain]View Plaincopy
  1. [Core]
  2. repositoryformatversion = 0
  3. FileMode = False
  4. Bare = False
  5. Logallrefupdates = True
  6. Symlinks = False
  7. IgnoreCase = True
  8. Hidedotfiles = dotgitonly
  9. [remote "origin"]
  10. URL = https://github.com/cncounter/translation.git
  11. Fetch = +refs/heads/*:refs/remotes/origin/*
  12. [branch "master"]
  13. Remote = Origin Master
  14. Merge = Refs/heads/master
  15. [Remote]
  16. Pushdefault = Origin
  17. [Credential]
  18. Helper = Store


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

[Plain]View Plaincopy
    1. [branch "master"]
    2. Remote = Origin Master
    3. Merge = Refs/heads/master


As shown in the following:

Save, test again, OK, can pull normally:

[Plain]View Plaincopy
    1. git.exe pull -v --no-rebase --progress  "origin"   master  
    2.   
    3. from https://github.com/cncounter/translation   
    4. * branch             master     -> fetch_head  
    5. = [up to  date]      master     -> origin/master   
    6. already up-to-date.  
    7.   
    8. 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]

Summarize

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.

Related articles
    1. Directory
    2. Installing and configuring Git
    3. Installation and Configuration Tortoisegit
    4. Git and tortoisegit basic operations
    5. markdown Example
    6. Solve the tortoisegit strange bad file number problem
    7. Join QQ Group GitHub home: 225932282

Date: 2014-11-29
Author: anchor: Http://blog.csdn.net/renfufei

GitHub version: Https://github.com/cncounter/translation/blob/master/tiemao_2014/GitHelp/05_BadFileNumber.md

Solve the tortoisegit strange bad file number problem

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.