Dalpapa
Dalpapa

Reputation: 177

Git corrupted with a commit

I am a bit new to git but I read the Git book from their site. So I started to use one with GitLab installed on my server.

I was working on SVN before so the first commit was an export of SVN. My friend is also working on the same project (his name's Lucas).

I created a branch origin/dev to get the origin/master fully stable and then develop on /dev. I also created a branch feature258 I'm working on. When I tried to pull the origin/dev to fetch the changes before merging my great feature I have this :

$ git pull origin dev
fatal: object 18c29b4c26d7b0d34719d10ada6901c6024f91e6 is corrupted
fatal: The remote end hung up unexpectedly

It appears that the 18c29b4 object is the pink commit (cf ScreenShot) which only modify a bit the .gitignore file

I ran git fsck --full but the clue that I'm having didn't help me :

$ git fsck --full
dangling blob 0c87d2eb401651ec3045eb0248d54ed546206dbe
dangling blob 1cd17aadc009ba9d39d1137533d65107ca54da95

The blob 0c and 1c are only one file that I modified in my last commit in feature_258.

I search over 3 hours on Google finding Linus Torvalds method and other StackOverflow posts without finding a good solution.

If it can save me, maybe I can rebase on branch before the BAD commit and re-do my work (that I saved in another directory to be sure)

Screenshot of SourceTree

Upvotes: 4

Views: 1260

Answers (1)

side2k
side2k

Reputation: 2074

Usually this:

fatal: The remote end hung up unexpectedly

Tells about connection termination. Maybe(maybe) this is not a Git repo problem, but some sort of system trouble. If I were you, I'd started with checking file permissions in repo. If you're using gitolite, then it'll be something like:

chown git:git -R $GITOLITE/repositories/my_repo.git/
chmod u+rw -R $GITOLITE/repositories/my_repo.git/

Then, if its not an issue, i'd tried to clone repo on server:

git clone $GITOLITE/repositories/my_repo.git/ ~/test_clone.git

Also there's one more suggestion - log in as user git and check git version.

Upvotes: 1

Related Questions