ruyadorno / git-bc

Git plugin to interactively list branches and checkout
MIT License
60 stars 6 forks source link

Added functionality to checkout remote branch #8

Closed mehtaad closed 8 years ago

mehtaad commented 8 years ago

Added functionality to git-bc to checkout remote branch that is not tracked locally. Use command: git bc -a

ruyadorno commented 8 years ago

Hi @mehtaad, I'm not sure I understand the goal of this PR and the direction it's going, in its current implementation git-bc is capable of checking out from remote branches using the command git bc -a - the result is the same as if you had run the git checkout remotes/remote-name/branch-name command - I'm not inclined to add extra functionality as the only goal of this plugin is just to be able to mimic a git branch + git checkout dynamic command.

Thanks for all the effort you put on this though, it's very much appreciated to see that git-bc is still getting some love :heart:

mehtaad commented 8 years ago

git bc -a does not switch and create selected remote branch. For example: C:\AngularAMD\angularAMD>git bc -a ‼ remote found origin ‼ All remote found origin/ ? Select a branch to checkout: (Use arrow keys)

master

  • nerdfiles-master remotes/origin/HEAD -> origin/master remotes/origin/devel remotes/origin/gh-pages remotes/origin/master remotes/origin/nerdfiles-master (Move up and down to reveal more choices)

If you select remotes/origin/nerdfiles-master, which is not a local branch, it will not create a local branch and will not switch to it.

But git checkout does. Hope this helps.

mehtaad commented 8 years ago

Hi Ruy,By the way I had a question:I have no clue how this git-bc works. How it know to invoke itself when user type something on command prompt?For example: git bc -r, its a git command so git should be in control, how do git-bc gets control? Thanks,Ashok From: Ruy Adorno notifications@github.com To: ruyadorno/git-bc git-bc@noreply.github.com Cc: mehtaad mehtaad@yahoo.com Sent: Wednesday, November 4, 2015 12:07 PM Subject: Re: [git-bc] Added functionality to checkout remote branch (#8)

Hi @mehtaad, I'm not sure I understand the goal of this PR and the direction it's going, in its current implementation git-bc is capable of checking out from remote branches using the command git bc -a - the result is the same as if you had run the git checkout remotes/remote-name/branch-name command - I'm not inclined to add extra functionality as the only goal of this plugin is just to be able to mimic a git branch + git checkout dynamic command.Thanks for all the effort you put on this though, it's very much appreciated to see that git-bc is still getting some love — Reply to this email directly or view it on GitHub.

ruyadorno commented 8 years ago

Hi @mehtaad, sorry for the long delay again :relaxed:

Git commands are invoked using the node.js child_process module. You can see it being required here and being used here.

All the best :wave:

mehtaad commented 8 years ago

Thanks. :)