git pull origin main
git fetch origin
git reset --hard origin/main
git clean -fdx
git pull
git reset --hard <commit>
git push -f
git reset --soft HEAD~1
git reset --hard HEAD~1
git branch -a
git branch -d <local-branch>
git push <remote> --delete <branch>
To force the local delete, use:
git branch -D <local-branch>
git checkout --orphan latest_branch
git add -A
git commit -am "clean up"
git branch -D main
git branch -m main
git push -f origin main
Chained all in one command:
git checkout --orphan latest_branch && git add -A && git commit -am "clean up" && git branch -D main && git branch -m main && git push -f origin main
git init
git add .
git commit -m "first release"
git remote add origin git@github.com:mrddter/new_repository.git
git push -u origin main
(optional) git push -f origin main
git remote set-url origin git@github.com:mrddter/new_repository.git
Verify that the remote URL has changed:
git remote -v
git config --list
git config user.email my@email.com
git config user.name "myname"
git config --list
git config --global user.email my@email.com
git config --global user.name "myname"
git checkout <to-branch>
git merge <from-branch>