Update the remote branch list on your local (Detlus Knowldge)
$ git remote update origin --prune
Replace the local version with the remote version
$ # fetch the latest changes
$ git fetch origin
$
$ # reset the branch to fetched changes (assuming you're working on master)
$ git reset --hard origin/master
Rename a local branch (pre-push to origin)
$ # checkout the branch to rename
$ git checkout branch-name
$
$ # rename the branch
$ git branch -m new-branch-name
Push and track a local branch to origin
$ # switch the branch to push and track
$ git checkout branch-name
$
$ # push the branch to origin
$ git push -u origin branch-name
No comments:
Post a Comment