git - Understanding how to work with 2 branches (master, staging) with Github? -


i have repo on github 2 branches "master" , "staging". use "staging" branch make updates first test on on test site. once updates ready merge "master" push live site.

i know if make changes local copy, can push "staging" branch , affect test site.

however, happens if need make change current "master" branch can push live site before "staging" updates ready.

i changed files on local copy in sync "staging" branch, how make change affects "master" branch?

do have have 2 copies of local files on pc, 1 "staging" , 1 "master"?

thank you!

just make changes master branch

git add .

git commit -m "your message"

git push

it update master branch. check out staging branch , git merge master merge changes master staging.


Comments