Create a new feature branch, say feature, and then switch to that branch. Implement the feature and commit it to our local repository. Push to the feature branch to the remote repository and create a pull request. After other teammate's review, the new change can be merged into the master or release branch.
If the file is different on your other branch, Git will not let you switch branches, as this would destroy your uncomitted changes. It is safe to try switching branches, and if Git warns you that "uncommitted changes would be overwritten" and refuses to switch branches, you can stash your changes and try again.
Just create a new branch:
git checkout -b newBranch
And if you do git status
you'll see that the state of the code hasn't changed and you can commit it to the new branch.
Just move to the new branch. The uncommited changes get carried over.
git checkout -b ABC_1
git commit -m <message>
Just create a new branch with git checkout -b ABC_1
; your uncommitted changes will be kept, and you then commit them to that branch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With