user1257724
user1257724

Reputation:

Committing/Pushing to GitHub Repo: Overwriting

When I previously committed and pushed to my github repo, I had compiled *.o files and some other text files and such that are included on the repo. I recently finished the project and I want to clean up the github repo by not having those *.o files and such. I cleaned up the source folder on my local repo, is there a chain of commands such that I can commit/push the files I want and only have those show up on the most recent master branch of the repo?

Thanks.

Upvotes: 0

Views: 70

Answers (2)

mvp
mvp

Reputation: 116048

Note that even if you delete these (probably big) *.o files, they will still be present in git history, and still occupy space in git object store. If you want to purge these files for good (even in history), you should use git filter-branch.

After you are done with this, be sure to edit .gitignore to avoid adding junk in the future.

Upvotes: 1

Matthew Asplund
Matthew Asplund

Reputation: 11

It is also always a good idea to have a .gitignore file in your repo so you don't accidentally add compiled binary or object files.

Upvotes: 1

Related Questions