Git and branches

ok, so apparently to create a new git branch in the remote repository we need:

git push origin origin:refs/heads/sandbox git fetch origin git checkout --track -b sandbox origin/sandbox git pull 

Now, if I want to return to the main branch, I can just do

git check wizard

If I want to return to the sandbox after returning to the master, I need

git checkout --track -b sandbox Origin / sandbox

or simply

git test sandbox

+4
source share
1 answer

git checkout sandbox will work. When you did checkout -b sandbox origin/sandbox , you created a local branch named sandbox that will track the remote origin/sandbox . To get the latest changes from the upstream to the local copy, do a git pull when on the sandbox branch.

+4
source

Source: https://habr.com/ru/post/1340908/


All Articles