How to remove Windows GUI Commit ? #24895
-
Hello, I use Windows 10 and the latest GitHub Desktop for Windows. I tried committing a file over 100 MB. It was a video, that I had forgotten to shrink. Now I’m stuck. I tried reversing commits in Windows GUI. I’ve uninstalled and reinstalled GitHub desktop. The commit is still there and stuck. I’ve installed GIT for the command line. I try command git log in bash. $ git log I have not idea where this git log is. I’m a complete Newby and had zero desire to delve into this literature. But not I have to. How do I clear out this Commit? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It’s still there because there is the .git folder inside the project. To delete the commit you have to the previous commit. Let’s make this in order… Command line method First of all you have to move in the project folder, than open here the git bash command line and type:
If you are in the right folder you see something like this:
In my case if I want to delete the last commit (if and only if I have not pushed yet), i have to take the token of the previous commit:
Then move back in time with reset, like this:
From here you can create a branch or create a new commit to push (if and only if you have not pushed yet). Github GUI method Dont really know, i dont use that, sorry I hope I have solved your problem -Gabriele- |
Beta Was this translation helpful? Give feedback.
-
@gz1968 we are in the process of shipping a feature to warn about committing files over 100MB in GitHub Desktop, which should hopefully prevent these types of issues from occurring in the future. Currently it isn’t possible to remove a large file in GitHub Desktop, but we do have a help article that walks through some of the available options for removing files from your repository’s history. You will need to use the command line for these steps. If you follow the steps that @wabri shared please note that the |
Beta Was this translation helpful? Give feedback.
@gz1968 we are in the process of shipping a feature to warn about committing files over 100MB in GitHub Desktop, which should hopefully prevent these types of issues from occurring in the future. Currently it isn’t possible to remove a large file in GitHub Desktop, but we do have a help article that walks through some of the available options for removing files from your repository’s history. You will need to use the command line for these steps.
If you follow the steps that @wabri shared please note that the
--hard
flag is destructive in nature – it will delete all of the files in the commit where you committed the large file. I would recommend using the--mixed
flag since that will leav…