0

I'm new to github and programming in general. As I updated and improved on my code, I realized that every "commit change" was added to my total commits. With that being said, I have now ended up with an embarrassing 119 commits and counting.

Being new to coding and programming, can someone tell me if there is anyway to clean out my commits? If so, please explain!

3
  • 2
    Don't be embarrassed by 119 commits. That's how it's meant to be used. Commented Jul 13, 2017 at 18:36
  • why do you want to delete the commit? Just because you have more commits? Its called a version control for a reason. Commented Jul 13, 2017 at 18:36
  • 3
    You can delete a commit, but you can also squash multiple commits into one and retain the changes. Does that sound like what you're after? Commented Jul 13, 2017 at 18:37

3 Answers 3

1

Don't be embarrassed! Instead, be proud you are version controlling your code so you keep track of changes and allow for a more maintainable system.

Perhaps, get even more efficient by adding clever commit messages on the way, explaining what version introduces what new feature or fix.

Sign up to request clarification or add additional context in comments.

Comments

0

As far as deleting old commits, there really is no reason to do so. If you are talking about having stored commits, then you can delete those. I recommend looking here for more info. Best of luck!

Comments

0

This is how you can delete a git commit. Using the command line.( you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.