Closed okkan closed 5 years ago
Twiggy branch-name
currently creates a branch if it doesn't exist.
I was actually just thinking the other day that I might change this so that it confirms if the branch doesn't exist since I've made typos trying to check out another branch and not noticed (which is not nice behaviour). I'd then probably implement Twiggy!
for intentional creation.
i mean it should be in quicklist, for example i move cursor to a remote branch or a local branch and then (may be [b] key) i press b key and i type new branch name... if i leave it empty, it will checkout as same name with remote branch. (webstorm has a feature like this "checkout as..." and it is very usefull)
Ah, cool, yes, I'm certainly open to that. Lemme think on an implementation and I'll get back to you!
So right now if I do :Twiggy Feature/new-cool-feature
it will create that branch based off the current branch I am in right?
Correct. I guess I could call that out more explicitly in the docs. It essentially acts like a cross between git checkout
and git checkout -b
. It also takes a base branch as a second parameter.
Hi there @okkan, very sorry for the long delay on this.
So I've pushed an initial implementation. Could you possibly clarify what you mean by "if empty, it will checkout as the same name with remote branch"? As I currently have it, you can put you cursor on any branch (local or remote), hit go
, and will be prompted to create a new branch based off of that branch. Leaving it empty, however, will cancel the operation.
@sodapopcan yeah you are right. Never mind that "if empty..." parts. Sorry it is my bad.
I've test it, it works like a charm. Thanx a lot.
Ok, awesome! I should probably make gc
work as well. I'll close this after I do.
git checkout -b [new-branch-name] command would be useful...