Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove file from git using Git-Extension GUI tool

I am using the latest verion of Git-extensions on Windows 10.

I would like to remove an already check in file from my git repo without deleting it locally.

I can not some to find out how to do this.

I have tried right clicking on it in the diff view, but no option is provided to remove.

In the commit view, there is a "delete" option. I have not tried that, because I am not sure if it will delete the local copy. Is this Commit view -> Delete option essentially a remove?

like image 867
Scorb Avatar asked Oct 20 '25 12:10

Scorb


1 Answers

Edit: Since then, I have added this option in GitExtensions. You could achieve that by selecting the menu item "Stop tracking this file" in 2 different places :

  • in the contextual menu in the commit form if the file has changed,
  • in the contextual menu of the file tree when you select a commit in the revision grid.

There is no way to do it, as I remember. But there is a really easy way to achieve that by tricking GitExtensions.

Just do:

  • rename the file
  • stage and commit just the 'delete' change on the file
  • rename the file to its original name

But that could easily be done with the command line by doing git rm --cached the_file.ext

like image 58
Philippe Avatar answered Oct 22 '25 01:10

Philippe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!