Reputation: 65
I am new to git and have come up against a scenario I am unfamiliar with.
The scenario is this.
After reading a few articles I believe this would be the way?
Is this the best workflow or am I missing something. I am very new to git.
Upvotes: 0
Views: 42
Reputation: 107738
You should've kept your first my-new-feature
branch. It's best practice to keep these branches around until the pull request is closed or merged.
So to get it back you would do:
git fetch
-- to ensure you have the latest branches and their latest commitsgit checkout origin/my-new-feature -b my-new-feature
This will then restore the my-new-feature branch on your local machine. Add as many commits as you wish to this branch, then push it again with:
git push
or perhaps git push origin my-new-feature
. Whichever works.Upvotes: 1