Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)
edited by

I made a mistake on my .gitignore file and accidentally started to push up a large directory with a very large amount of files (to Github). Realizing what I did I canceled the push (ctrl + c) partway through.

I ran git reset --soft HEAD^ and git reset to revert the commit and unstage my files. I then updated my .gitignore file.

Checking git status again I see all the correct files are ready to be pushed up to Github again, so I added, committed and pushed them.

Thing is git push origin master now seems to hang - nothing happens. I'm guessing because I canceled the last push partway through.

Would anyone know how I could fix this?

1 Answer

0 votes
by (119k points)
edited by

First, clone your GitHub repository again in a new folder.

Report all (or at least some) of your current modifications to your new local clone.

Add, commit and push from there, to see if the issue still exists.

Your local index of your current local cloned repository might be in an incoherent state: a new local clone might help.

Also, check out this Git Tutorial to know more.

Browse Categories

...