Practical Web Programming

Wednesday, August 07, 2013

git: Reset a remote repo url

If you just recently change your remote git repo name, you'll find out that your local repo that's pointing to the remote is now invalid. Here's a way to reset or update the url, assuming your are using github. 

git remote set-url origin git@github.com:kabalweg/myawesomeproject.git

git: Checkout a branch from a remote repo

If you already pushed a feature branch to origin and the deleted that branch in your local repository, you can get a copy that branch to your local using this git command:

$ git fetch origin
$ git checkout -b feature_branch_name origin/feature_branch_name

Recent Post