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'


No comments:

Post a Comment