0

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?

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34

1 Answers1

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