Remove commit

Sometimes when you COMMIT to GitHub a file larger than 100MB, the PUSH is rejected.


Your branch is ahead of 'origin/master' by 5 commits.
You have to remove the last (or more) COMMIT, the following command does not change your code:

git reset --soft HEAD~1

Then fix the problem, usually by marking the large files in .gitignore


$ git commit -a -m "added gitignore with _DATA/* directory"


$ git status

Untracked files:
(use "git add ..." to include in what will be committed)

src/_DATA/amazon_baby.csv
src/_DATA/amazon_baby.gl/
src/_DATA/home_data.gl/
src/_DATA/image_test_data/
src/_DATA/image_train_data/
src/_DATA/people-example.csv
src/_DATA/people_wiki.csv
src/_DATA/people_wiki.gl/
src/_DATA/song_data.csv
src/_DATA/song_data.gl/


Then push again and pray:


$ git push


 $ git status
On branch master
Your branch is up to date with 'origin/master'




As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles