rebase the last 4 commits:
git rebase -i origin/<branch name>~4 development
clone again in a different directory:
git worktree add ../the_project_2 <branch>
intereactive rebase: rebase -i origin/development
create branch:
git branch <branch>
OR
git checkout -b <branch>
delete local branch:
git branch -d <branch>
delete remote branch:
git push <remote> --delete <branch>
show commmit hist:
git log --oneline
revert to a specific commit:
git checkout <commit-id> .
get a warming if there are changes on the remote branch during a force push
git push --force-with-lease
Don’t forget the final ‘ .’ — You aren’t required to add this, and it may look like it has worked but if you leave this off it will take you to a new “detached head state” where you can make changes and it will allow you to make commits, but nothing will be saved and any commits you make will be lost.
git revert --no-commit 0766c053..HEAD git commit
- Create a new stash:
git stash -m <message>
- Remove a stash:
git stash drop <stash>
- List stashes:
git stash list
Get rid of old commits that are added to end of your MR:
git fetch
git rebase origin/<branch you're merging to>
git push --force-with-lease