Reputation: 3754
Is it possible to remove files from a Git repository branch, while another branch is checked out?
I'd like to do this in order to resolve some conflicts with files that are .gitignore'd in the checked out branch but still in the repository for a branch I want to check out. Caused by some hasty decissions while setting up a git repository for inherited code in Netbeans.
Upvotes: 0
Views: 447
Reputation: 55523
Wile technically it's possible to replace the tip commit on a branch with another one, you'll have to cook it programmatically which is more hassle than you're trying to avoid.
So another option would be to do that manually using a separate work tree and an index. This article explains how to do that. Basically, you check out that branch to a separate work tree (and possibly using a separate index), and fix up the offending commit.
Upvotes: 1