Only a single (grafted) commit left in branch after checkout with extension?
See original GitHub issue- Extension version: 0.5.0
- VSCode Version: 1.32.1
- OS: Windows 10 64-bit
Steps to Reproduce:
Unclear. I tried to reproduce the problem with a simplified setup, but to no avail. Here is a list of things I remember:
- Had accidentally staged all changed/untracked files
- Unstaged them one by one by clicking the
-button on them in source code management sidebar in quick succession (in parallel? it tooks quite a while until it finished in the background) - Installed GitHub extension
- The working copy had branch
develchecked out, potentially not up-to-date with remote - I wanted to edit something a feature branch call
documentation/graph-traversal-build-fix - There was already a local branch with that name, but it was behind the remote branch (same name)
- I had merged
origin/develintodocumentation/graph-traversal-build-fixon a different machine - My local branch was behind but that merge commit
- I had merged
- Via the GitHub extension, I located the corresponding PR for that branch and clicked the Checkout button
- When I checked
git logthe next time in a command prompt, it only gave me this:
So the entire history of that branch looks like a single commit and is the merge commit (the one I was behind before the Checkout via the GitHub extension)>git log commit b7aa332a80c16be8c74c51fb7c2f7cdb8e4e8ff2 (grafted, HEAD -> documentation/graph-traversal-build-fix, origin/documentation/graph-traversal-build-fix) Author: Simran ... Date: Fri Mar 8 15:18:44 2019 +0100 Merge remote-tracking branch 'origin/devel' into documentation/graph-traversal-build-fix - Shortly after, I noted that it said
grafted. In a shallow clone of a repository, it would be expected that you see a truncated history. However, my repo wasn’t a shallow clone but a normal working copy with the entire history. - The PR on GitHub based on the
documentation/graph-traversal-build-fixbranch looked alright, so I deleted my local branch and checked out the remote branch - but the history remained a single commit - Then I tried to
reset --hard, but this didn’t change anything either
I cloned the entire repo to a new folder, and there the branch is fine, i.e. the entire history is listed as expected. Does this mean some cache in the original working copy got corrupted?
What does the GitHub extension do exactly if you check out pull requests? Is there any chance for breaking the working copy as described? Is it caused by how the extension uses Git, or does this sound like a bug in Git itself?
If you want to analyze the (possibly) corrupted working copy, download it here: arangodb-grafted.7z (1.1 GB)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:7 (1 by maintainers)
Top Results From Across the Web
git shallow clone - how do I remove the "grafted tag" and what ...
Using git filter-branch tells Git to copy the commits. The copies obey the shallow cutoff, so that they are truly the only commit...
Read more >git-filter-branch Documentation - Git
NOTE: This command honors .git/info/grafts file and refs in the ... This is not a real filter executed for each commit but a...
Read more >Manage Git branches | IntelliJ IDEA Documentation - JetBrains
In the Branches popup or in the Branches pane of the Git tool window, select a branch that you want to check out...
Read more >10 things I hate about Git - Steve Bennett blogs
But the shortcut for “git branch” combined with “git checkout”? ... To reset one file in your working directory to its committed state:...
Read more >10. Editing History - Git Pocket Guide [Book] - O'Reilly
The general purpose of git rebase is to move a branch from one location to ... but merely abandoned: they are no longer...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Simran-B I had the same problem. Solution was to delete the
.git/shallowfile.Same here.
git fetch --unshallowdid the job.