Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git/gitk shows me unknown/invalid sha1 id for a folder but not from its parent folder.

Tags:

git

I have the following folder

Views/Shared/Base/

Where I have been developing parts of a layout

header.cshtml
footer.cshtml
mainNav.cshtml

So at some point I start creating the 'Base' folder with an initial commit for those files (in a branch devivated from master). That initial commit goes to our master because we are in a earlier stage, so no problem at all. Let's call that commit, commit A.

Then, I continue developing those files and creating more, more commits for them and taking them to our master so the rest of the team could benefit of those changes. At least that was the idea. Let say I created commit B, C, D.

But last week, all our team should sync with our master, that was mandatory. I continue developing, and create a commit E. But I didn't take E to master yet, today I sync my branch (I'm the only who use this branch to developed 'Base') with master so I could have all the changes from the team and see if everything was okay.

But despite the merge was fast forward, I see with surprise that the folder 'Base' seems like stay on commit A, not E, which is my most recent commit.

At first I though about a really, really bad merge from someone on the team. But I didn't find nothing like that. The comments and the tree (I checked through gitk) didn't show nothing like that.

And the most weird thing is the following:

One powerful feature of git, is that you can check history of a folder or a single file, am I right?

Well, look at this. Using gitk I checked 'Views' and look for commit D and E. Of course, gitk found them and show me the commits of header.html, footer.html inside 'Views/Shared/Base'.

Cool, but this happened when I did the same for base.. once I did gitk for 'Views/Shared/Base', and look for commits D & E, gitk show me an error: "La id SHA1 D/E es desconocida" which in english I believe the error is translated to "the id SHA1 D/E is unknown" or something like that.

So I don't understan why I can find the commit in the parent folder but not in the inner one.

I don't know what is going on, or how to solve it. Is our repo corrupted?

like image 610
raulricardo21 Avatar asked Jul 21 '15 19:07

raulricardo21


1 Answers

Is our repo corrupted?

First, simply clone again that repo and see if master (and Base/ content) are ok.

today I sync my branch (I'm the only who use this branch to developed 'Base')

If you are the only one working on a Branch, you should rebase it on top of master in order to benefit from the latest master content.

git checkout myBranch
git fetch
git rebase origin/master

This should show Base/ with your latest content.

like image 100
VonC Avatar answered Oct 19 '22 18:10

VonC