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
- 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 the 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 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
- [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, 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
- 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:
[Plain]View Plaincopy
- [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 bar in this configuration file, [branch "master"] and the following remote = Origion in this section, now plus master becomes:
[Plain]View Plaincopy
- [branch "master"]
- Remote = Origin Master
- Merge = Refs/heads/master
As shown in the following:
Save, test again, OK, can pull normally:
[Plain]View Plaincopy
- git.exe pull -v --no-rebase --progress "origin" master
-
- from https://github.com/cncounter/translation
- * branch 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]
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
- Directory
- Installing and configuring Git
- Installation and Configuration Tortoisegit
- Git and tortoisegit basic operations
- markdown Example
- Solve the tortoisegit strange bad file number problem
- 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