1

I need to remove a file from history. I don't have commandline access to GitHub. Kindly help if this can done through UI itself.

vinod-d
  • 73
  • 1
  • 1
  • 7
  • You should have command line access. https://help.github.com/articles/removing-files-from-a-repository-s-history/ – User123456 Nov 13 '18 at 04:01

3 Answers3

2

You can't delete the file from history, but you can delete it from the repository by following this help article

Alternatively, you could do a cherry-picking using one of the Git GUIs software, then cherry-pick all the commits, except for the one that you wanted to removed, into a new branch. Then, delete the old branch.

Andreas
  • 2,455
  • 10
  • 21
  • 24
  • @BRjava I have committed the file again removing the sensitive data. The issue is the sensitive data is still there in history. I want to remove that – vinod-d Nov 13 '18 at 05:31
  • @vinod-d I added another solution to my answer – Andreas Nov 13 '18 at 05:45
1

TO achieve this, you have to have command line access. Delete file from history

But Using UI , you could delete the file from the repo (branch) Ex: enter image description here

Click the delete button on top right corner and commit.

User123456
  • 2,492
  • 3
  • 30
  • 44
0

You don't need command line access to GitHub, only to your own local clone, where you can:

Then you git push --force.

But the alternative, if you really don't want to use any command line, even locally... would be to contact GitHub support, asking them to remove the file from your remote repo history.
That is a last resort option though, since you are supposed to be able to do that on your own.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250