Monday, 24 September 2018

GIT: Create and push a new local branch to a remote Git repository and tracking information | GIT Delete Local Branch | GIT Delete Remote Branch

What we have to do first need to create a local branch from current working branch using below command:

git checkout -b my_branch

And then have to execute below command to push newly created branch to git repository:

git push -u origin my_branch

And then you need to set your upstream branch to pull changes:

git branch --set-upstream-to=origin/my_branch

Below command is to delete a local branch:

git branch -D my_branch

Below command is to delete a remote branch:

git push origin --delete my_branch

0 comments:

Post a Comment