top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

git bad file number

+1 vote
835 views

I've been trying to git archive a new version of the system I'm currently working on, but, suddenly, the git archive command, which I used to use, stopped working.

I use the git archive followed by the git diff + filters, that is necessary only to get the diff between the tagged versions.

Right now, I can't generate the archive (a zip package) containing the version changes because of this error: sh.exe": /bin/git: Bad file number

I tried the git diff + filters (ACMRT and stuff) and it shows me the correct diff, so, I discarded the problem with the diff. Later, I tried the `git archive only, with a test file, and it worked as well. But if I use both together, it gives me the error.

posted Sep 18, 2013 by Kumar Mitrasen

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Sounds like it's either a problem with the of rerouting stdout/stderr in your script or you're using ssh to access the repository and failing to get through to the server?

answer Sep 18, 2013 by Dewang Chaudhary
I don't think it might be a connection issue, cuz I was able to generate the package untill the 1.3.3 version of the system. Since then, I can't generate for further versions. If I attempt to generate a previous package, it works! :
I was wondering if is there any available command to use, in order to make Git ignore all previous versions and start picking everything within the range I set. Actually this is exactly what Git should be doing!
Perhaps there is a difference in the stdout/stderr outputs between the  working and non-working extracts? Does it look the same when you try to do the commands manually?
Similar Questions
+1 vote

Perhaps my git workflow is wrong.

I have committed numerous times in order to complete a task, but when the code is to be reviewed, Id like to show a non-contiguous view of my changes, which do not include the commits other developers have made. Is this possible?

Or should I be creating a branch and showing the differences from the master and my branch when it comes to a code review?

0 votes

I have a problem with an already committed file into my repo. This git repo was converted from svn to git some years ago. Last week I have change some lines in a file and I saw in the diff that it is marked as binary (it's a simple .cpp file). I think on the first commit it was detected as an utf-16 file (on windows). But no matter what I do I can't get it back to a "normal text" text file (git does not detect that), but I is now only utf-8. I also replace the whole content of the file with just 'a' and git say it's binary.

Is the only way to get it back to text-mode?:
* copy a utf-8 version of the original file
* delete the file
* make a commit
* add the old file as a new one

I think that will work but it will also break my history.

Is there a better way to get these behavior without losing history?

+1 vote

I would like to know why GIT calculates checksum of a file.Typically, checksum is used for the purpose of integrity. An example would really help.

+3 votes

I opened a file and wrote a piece of code.
When I ran $git diff
it is showing the differences what I did.
Can I get back the file (version) which is in remote branch ?
Is there any command ?

...