0

I have a file 3 Mb large in Github, online only. I want to delete or move it, but Github won't let me do anything with it. It says 'This file has been truncated, but you can view the full file.' That is all. What can I do to move/delete it?

Danny
  • 528
  • 1
  • 4
  • 27
  • 1
    Could that be because the file is deleted on a previous commit? Or it can the be current state that the file is marked as deleted, and you just need to sync/push your current commit. Please show the output for "git status" command at your repository, how does it refer to the files you're trying to delete, are they still being tracked? – Kerem Oct 21 '15 at 19:55
  • Possible duplicate of [How to remove/delete a large file from commit history in Git repository?](http://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – mgarciaisaia Oct 21 '15 at 20:04
  • @mass Thank you! The status is: "Deleted: data2.txt" So it is not pushed. Now I see my mistake: I am not logged on in Git. How do I log in? – Danny Oct 21 '15 at 20:05
  • 1
    Are you on windows? AFAIK on osx and linux you get an automatic confirmation to get your public ssh key and then you forget about logging in when working from command line. Windows also has git shell but i recommend using github's client. – Kerem Oct 21 '15 at 20:10
  • 1
    @mass I am on Linux. I am new with github. You have shown me the right way, when I printed "git status", I saw I had to go on to log in. How do I make your comment into an answer? :) Now it has synchronized. The problem is solved. – Danny Oct 21 '15 at 20:12
  • I posted my comment as an answer and edited your tags. Im glad your issue is resolved. – Kerem Oct 21 '15 at 20:18

2 Answers2

1

Sometimes all you need is a git status command.

Kerem
  • 2,867
  • 24
  • 35
0

First, run git clone <github url>. Then change directories into that folder cd <folder name>. Run git rm <filename> to remove the file from the repository. If you want to move it, run mv <filename> <folder to be moved to>. After deleting run git commit -m "<commit comment>". If you moved the file, run git add <newfilename> and then git commit -m "<commit comment>". The commit comment should describe the changes you made (such as deleting the file). Then run git push, which will push your changes to Github.

Zach P
  • 560
  • 10
  • 30