question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to branch function to checkout branch upon creating

See original GitHub issue

As 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jcubiccommented, Dec 2, 2018

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.

1reaction
jcubiccommented, Dec 2, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found