Custom Search

Tuesday, November 18, 2014

How To git checkout branches from different remotes

1)
Add your remote

#git remote add github-remote https://github.com/myrepo/MYPRO.git

2)
Fetch remote

#git fetch github-remote

3)
Checkout the branch "migration_django_15" from the remote "github-remote" and rename to "migration_django_15_github"

#git checkout -b migration_django_15_github --track github-remote/migration_django_15

4)
Now in local machine, I am in "migration_django_15_github" branch.
Pull the latest changes from "migration_django_15_github" branch in the remote https://github.com/myrepo/MYPRO.git

#git pull





No comments:

Post a Comment