Reputation: 3386
I follow https://www.atlassian.com/git/workflows for Git Workflow, so I have master, develop and feature-one branches for my current project.
I have developed some codes in feature-one branch and not committed them yet. Now I like to create another feature branch called feature-two to develop and test some new code.
My problem is that the new, uncommitted code from feature-one branch is available in all branches and when I create a new feature branch (here feature-two) from develop branch, it includes the new codes from feature-one branch too.
Upvotes: 0
Views: 455
Reputation: 388413
Either commit the uncommitted code, so you don’t lose it (remember: uncommitted code does not exist in the Git repository, so deleting it will be permanent!), or you can stash it so you can continue working on it later.
To delete a branch, you can use git branch -d branchname
. This will only work if you have merged the changes in somewhere else (e.g. master or develop), so again, you don’t lose any work. If you want to delete it anyway, you can use git branch -D
(upper case D) instead.
Upvotes: 1