5
I am working on a project that has two branchs (master and dev).
I started the implementation of a new Feature in the system but, halfway through, I realized I was making the changes in the master, instead of the dev.
There’s a way that I can finish the code and commit directly to the dev branch and leave the master as it was before I started coding?
Or the way it’s gonna be:
Copy everything I’ve done; To delete the project; Download again from the repository; Go to dev branch; paste everything I did.
Thanks to those who can help.
Have you committed any of these new master changes??
– viana
@Viana not yet
– Guilherme Golfetto
Obviously you can finish coding and create a new branch with these changes: Ex: git checkout -b Feature/2 ... ai you 'comitta' inside. Then just merge with dev. It’s an output.
– viana
If you haven’t added or committed or pushed the master yet, it’s very simple to resolve. Do what I’m doing. You can even do it before you finish coding. It will create a new branch and migrate automatically. But watch out for the Feature number. Try to put something that doesn’t exist yet.
– viana
@So, I created a new branch here, with another name and everything but my master is still with the changes, I can just undo the changes?
– Guilherme Golfetto