Add option to branch function to checkout branch upon creating
See original GitHub issueAs a convenience, it would be nice if the branch
function offered an option to checkout a branch after it’s created. Often, when you create a branch, you also want to switch to it. This would eliminate a step in the calling code. This is similar to the checkout -b
command in git. I’m thinking the option could be checkout = true
.
git.branch({ ...repo, ref: 'develop', checkout: true })
The alternative would be to add this functionality to checkout
(something like create = true
). Right now, the checkout
command will implicitly create a new remote tracking branch, but that’s not the same use case as creating a local branch (unless I’m mistaken).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Git Checkout | Atlassian Git Tutorial
Git branching intro. Create, list, rename, delete branches with git branch. git checkout: select which line of development you want and navigate branches....
Read more >Git Branch Explained: How to Delete, Checkout, Create, and ...
If you only want to see the remote branches, use the -r (or --remotes ) option. Checkout a Branch. To checkout an existing...
Read more >4 ways to create a Git branch quickly by example
The easiest way to create a Git branch is to use the branch switch and provide a branch name. The only shortcoming of...
Read more >How to Create a New Branch in Git {7 Methods Explained}
The git checkout command automatically creates the remote branch locally with the original name. Create a Branch in a Remote Repository. Use the ......
Read more >Git Create Branch - Tools QA
git branch command to create the branch; git checkout command to switch to the branch. Executing both of these branches takes some time,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After consideration it actually don’t matter which function have this feature it’s just branch+checkout so it can be added to both or either of the commands, so I’m ok with this implementation.
I think it should be in checkout since in git client there is
git checkout -b
so is reasonable to have the same in isomorphic-git