Skip to main content
Post Undeleted by rnwed_user
Post Deleted by rnwed_user
Post Undeleted by rnwed_user
Post Deleted by rnwed_user
Post Undeleted by rnwed_user
Post Deleted by rnwed_user
Post Undeleted by rnwed_user
Post Deleted by rnwed_user
added 30 characters in body
Source Link
rnwed_user
  • 1.6k
  • 12
  • 16

method 1 if you have many commits

git rebase -i master then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
f etc2
f etc2

and press this command

git push origin +head

method 2 if you have few commits you can do this to delete a commit, you need to do same for delete your second commit and so on

git reset --soft HEAD^1 // or git reset --soft head~1
git commit --amend //then press `:wq` 
git push -f

method 3 if you already have one commit and you dont want submit another commit more

git add files...
git commit --amend  //then press `:wq`
git push origin +head

method 1 if you have many commits

git rebase -i master then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
f etc2
f etc2

and press this command

git push origin +head

method 2 if you have few commits you can do this to delete a commit, you need to do same for delete your second commit and so on

git reset --soft HEAD^1
git commit --amend //then press `:wq` 
git push -f

method 3 if you already have one commit and you dont want submit another commit more

git add files...
git commit --amend  //then press `:wq`
git push origin +head

method 1 if you have many commits

git rebase -i master then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
f etc2
f etc2

and press this command

git push origin +head

method 2 if you have few commits you can do this to delete a commit, you need to do same for delete your second commit and so on

git reset --soft HEAD^1 // or git reset --soft head~1
git commit --amend //then press `:wq` 
git push -f

method 3 if you already have one commit and you dont want submit another commit more

git add files...
git commit --amend  //then press `:wq`
git push origin +head
added 20 characters in body
Source Link
rnwed_user
  • 1.6k
  • 12
  • 16

method 1 if you have many commits

git rebase -i master then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
f etc2
f etc2

and press this command

git push origin +head

method 2 if you have few commits you can do this to delete a commit, you need to do same for delete your second commit and so on

git reset --soft HEAD^1
git commit --amend //then press `:wq` 
git push -f

method 3 if you already have one commit and you dont want submit another commit more

git add files...
git commit --amend  //then press `:wq`
git push origin +head

method 1 if you have many commits

git rebase -i master then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
f etc2
f etc2

and press this command

git push origin +head

method 2 if you have few commits you can do this to delete a commit, you need to do same for delete your second commit and so on

git reset --soft HEAD^1
git commit --amend
git push -f

method 3 if you already have one commit and you dont want submit another commit more

git add files...
git commit --amend  //then press `:wq`
git push origin +head

method 1 if you have many commits

git rebase -i master then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
f etc2
f etc2

and press this command

git push origin +head

method 2 if you have few commits you can do this to delete a commit, you need to do same for delete your second commit and so on

git reset --soft HEAD^1
git commit --amend //then press `:wq` 
git push -f

method 3 if you already have one commit and you dont want submit another commit more

git add files...
git commit --amend  //then press `:wq`
git push origin +head
added 441 characters in body
Source Link
rnwed_user
  • 1.6k
  • 12
  • 16

method 1 if you have many commits

git rebase -i master then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
f etc2
f etc2

and press this command

git push origin +head

method 2 if you have few commits you can do this to delete a commit, you need to do same for delete your second commit and so on

git reset --soft HEAD^1
git commit --amend
git push -f

method 3 if you already have one commit and you dont want submit another commit more

git add files...
git commit --amend  //then press `:wq`
git push origin +head

git rebase -i master then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
f etc2
f etc2

and press this command

git push origin +head

method 1 if you have many commits

git rebase -i master then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
f etc2
f etc2

and press this command

git push origin +head

method 2 if you have few commits you can do this to delete a commit, you need to do same for delete your second commit and so on

git reset --soft HEAD^1
git commit --amend
git push -f

method 3 if you already have one commit and you dont want submit another commit more

git add files...
git commit --amend  //then press `:wq`
git push origin +head
Source Link
rnwed_user
  • 1.6k
  • 12
  • 16
Loading