0

I need delete all local commits from a Git project. I need to do so that I can commit everything as a single unique commit before sending it upstream.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
  • http://git-scm.com/book/be/v2/Git-Tools-Rewriting-History ... you're welcome! (note: If you don't ask a proper question, no one can give you a proper answer. Of course we can help you (that's what SO is for), but in order to do that, you have to explain which concrete problem you are having and what you have found out so far) – Felix Kling Mar 05 '15 at 18:51
  • Also see http://stackoverflow.com/q/1657017/218196 – Felix Kling Mar 05 '15 at 19:41
  • Something about this seems off. Do you want to just start your Git history over with the last commit as the original commit? – Makoto Mar 05 '15 at 21:04

1 Answers1

1

You should do whats is called squash.

git rebase -i HEAD~100 will open a dialog where you can squash all your pervious (100 commits in this sample) into a single commit.

Click here for more info: git squash

harpun
  • 4,022
  • 1
  • 36
  • 40
CodeWizard
  • 128,036
  • 21
  • 144
  • 167