Tuesday 30 October 2018

git creating a branch and setting upstream branch

If you are working on a new task and you want to create a user branch and push it to remote, you can do so, using below methods.

Assuming you are in develop branch

git checkout develop #Recommended to always point your branch to same commit as develop
git pull                       #Recommened to get the latest from remote
git branch users/venkat/performanceFix #Creating new branch for your needs
git checkout users/venkat/performanceFix #Checking out branch locally
git push origin users/venkat/performanceFix  #Pushing the branch to remote
git push --set-upstream origin users/venkat/germanyThresholdChanges #Setting upstream branch for  current branch as the newly created branch


or

git checkout -b users/venkat/performanceFix Origin/venkat/performanceFix #single step if the remote branch already exists

or

If the remote branch already exists and you want to set the remote branch as current branch upstream.

git branch users/venkat/performanceFix
git checkout users/venkat/performanceFix
git branch --set-upstream-to origin/users/venkat/performanceFix

No comments:

How to Handle SSIS Database movement from one environment to another

Below are the steps to follow the movement of SSISDB from one environment to another: -- opening the existing Database master key in S...