Skip to content

Application Example

Ethan edited this page May 18, 2022 · 2 revisions

How to change Git Remote Origin

To backup/mitigate your Git repository or merge the existing ones, you need to change the git origin to a new URL remote.

git remote set-url <remote_name> <remote_url>: git remote set-url origin git@github.com:Ethanlinyf/Archive-General-Pure-Emacs.git git remote -v

How to delete all commit history in GitHub

Checkout

git checkout –orphan latest_branch

Add all the files

git add -A

Commit the changes

git commit -am “commit message”

Delete the branch

git branch -D main

Rename the current branch to main

git branch -m main

Finally, force update your repository

git push -f origin main

Clone this wiki locally