Useful commands for using [[Git]].
## Squash commits in local branch
https://stackoverflow.com/questions/25356810/git-how-to-squash-all-commits-on-branch
```sh
git checkout yourBranch
git reset $(git merge-base main yourBranch)
git add -A
```
## Renaming branches
https://stackoverflow.com/questions/6591213/how-do-i-rename-a-local-git-branch
To rename the current branch:
```sh
git branch -m <newname>
```
To rename a branch while pointed to any branch:
```sh
git branch -m <oldname> <newname>
```