For work I had to clone a repository. On my local repo I made some changes on the master branch. But now I need to make those same changes on a new feature branch in the remote repo. How do I do that without changing the master branch of the origin repo. I'm following this tutorial which says that I have to pull from origin but I'm afraid my changes will overwrite the master branch of the origin. Maybe what I should have done was to create a local feature branch instead of modifying code on the master branch?
Asked
Active
Viewed 47 times
0
-
Regret Type 3? https://stackoverflow.com/a/59675191/341994 – matt Sep 15 '20 at 13:15
1 Answers
1
Create a new local branch
git checkout -b myFeatureBranch
Then set an upstream for it and push it to the server
git push --set-upstream origin myFeatureBranch

Ôrel
- 7,044
- 3
- 27
- 46