Skip to content

jbbrwcky/GitBranchTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

GitBranchTool

Useful bash scripted function to use when you have a lot of git branches or branches that have long names. An example of a git branch command output:

UserOne/Project1-100-Some-Html-Code
UserOne/Project1-149-Some-CSS-Code
UserOne/Project1-150-Some-SCSS-Code
UserOne/Project1-223-Some-Angular-Controller
UserOne/Project1-244-Some-Angular-Directive
UserOne/Project1-301-Some-Angular-Service

As you might see, switching to each one manually via git checkout is going to be a bit laborious even with tab completion - more so with people who maintain very large amounts of branches (which isn't difficult to attain!).

So this tool makes that quicker and much easier to deal with. Now all you have to do is type the command and an identifying (unique) branch name so for example:

ggo 149

This will search the git branches and automatically switch to the branch that has the 149 in it (UserOne/Project1-149-Some-CSS-Code). More than that this will, if you give it something that isn't completely unqiue, return a list of possible branches to switch to. It will expect an input in the form of an index (which it provides as a list for you for you) so all you have to do is input the index and it switches. It even colours it for you to make it nice and simple to see.

About

Small bash scripted git branch tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages