This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! GitCheckoutBranch(branch) | |
| " branch can look like this: "/remotes/origin/master [hash] info" or this: "master [hash] info" | |
| let l:name = split(split(trim(a:branch), "", 1)[0], "/", 1)[-1] | |
| " just show what is happening | |
| echo "checking out ".l:name."\n" | |
| " you can use !git, instead of Git, if you don't have Fugitive | |
| execute "Git checkout ".l:name | |
| endfunction |