git - How do I simply branch/copy master and upload this branch to GitHub? -
i must missing obvious, i'm struggling this.
i want copy 'master' repo on local computer , create own branch 'copy-of-master' , upload github (with no changes).
i want able see on github new 'copy-of-master' branch same master, nobody else use can upload changes without touching master.
somebody else take care of later merging 'master'.
to add confusion have used combination of phpstorm , git on command line.
here's have done, , why can't understand phpstorm doing:
- git checkout master
- added new branch in phpstorm (from master i'm guessing). did show current branch master in bottom right corner.
- 'git status' shows i'm in 'copy-of-master' branch.
now, surely 'push' repo , there should branch.
the problem i've tried in phpstorm , comes this:
no tracked branch. use checkbox below push branch manually specify, showing 5 recent commits
it shows 5 random commits have been done on variety of times.
also, @ bottom shows option "push current branch alternative branch" alternative branch branch i'm on anyway (??).
i've used phpstorm push before , ended automatically merging work main branch. don't want mess time.
nobody else working on repo @ all.
i've never used phpstorm before, assuming can detect git changes make command line (like creating new local , remote branches), can of things want exclusively using git command line:
git checkout -b copy-of-master git push -u origin head this create local branch copy-of-master based off of master, , set automatically track remote version origin/copy-of-master.
documentation
checkout -b: "specifying-bcauses new branch created if git-branch(1) called , checked out."push [-u|--set-upstream]: "for every branch date or pushed, add upstream (tracking) reference, used argument-less git-pull(1) , other commands. more information, seebranch.<name>.mergein git-config(1)."
Comments
Post a Comment