Skip to content
Vlad Volkov edited this page Jan 16, 2021 · 4 revisions

CLI Cheatsheet

Rename git origin url

Use case: this morning you've discovered that remote repo url was changed and you want to sync up with it

Get list of all remotes

git remote -v

Change repository url

 git remote set-url origin https://github.com/bn-digital/<NEW-REPO-NAME>.git

Rename local branch to follow remote

Use case: this morning you've discovered that remote branch was renamed and you want to sync up with it

git branch -m <OLD-BRANCH-NAME> <NEW-BRANCH-NAME>
git fetch origin
git branch -u origin/<NEW-BRANCH-NAME> <NEW-BRANCH-NAME>
Clone this wiki locally