I currently have a private repo with the url of https://github.com/my-name/Pain.git
I pushed the current version and have another, different version in a different folder. I want to branch off of this repo above and push this other folder as branch "Stress". I opened my folder and did
git init
and then
git remote add origin https://github.com/my-name/Pain.git
then I was assuming i'd be in the repo at the master branch, but when i do
git branch
I get nothing, and when i try to create a new branch to push this new folder to, I get this:
git branch Stress
fatal: Not a valid object name: 'master'.
How do I simply go to the already created repo, create a new branch, and then push my alternate version to that new branch without interfering with the master?
CodePudding user response:
try this;
git checkout -b Stress
this code creates a branch named stress and activates that branch