branch - Git: change HEAD -


i have repository on bitbuket 2 branches:

 $ git branch -a * master   remotes/origin/head -> origin/master   remotes/origin/master   remotes/origin/ng-1 

master contains old tool code, , ng-1 - new.

what want - switch master ng-1 when git pull executed - pull code "master" - new code.

let's - want "move" code master ng-1 - , ng-1 master.

as googled - can done with:

$ git update-ref head ng-1 

thus - "main default" branch became ng-1 , master saved "backup".

if go wrong - i'll can vice versa:

$ git update-ref head master 

am correct?

what want - switch master ng-1

// checkout new branch git checkout ng-1 

... when git pull executed - pull code "master" - new code

// pull "old" changes - if ng-1 forked master no update should pulled git pull origin master  // ng-1 contains "new" code well. 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -