I created a feature/A branch off develop. I did some coding in feature/A branch and decided to abandon that work. I changed my active branch from feature/A to develop, and I saw the work done (but not committed) in feature/A was present in the develop branch also. Does switching back to the parent branch imply an end-feature action request? I wanted to leave feature/A as an orphan branch that could then be deleted.
Hello! To keep that work in the old branch, you'll need to commit those changes before switching branches (you don't need to push them, but if you don't they'll only stay on your local machine). If you'd like to store the changes without commiting them, you can use the "Stash" button.
If you'd like to switch branches and discard all the changes you've made, just check the "Clean" box when switching branches (this will discard all of the changes you've made).
Thanks for the info. I was beginning to think I couldn't work with the Gitflow since I didn't understand how that happened. Now I'll go back to experimenting with it. But what happened to Git's normal action of not allowing a branch switch with uncommitted work outstanding?
Thanks for the tip. I didn't know about the Clean option; it's good to know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.