Si tengo las siguientes sucursales en gitrama cambio en git por nombre parcial
1194-qa-server
master
remotes/origin/1178-authentication
remotes/origin/1194-qa-server
remotes/origin/HEAD -> origin/master
remotes/origin/master
quiero cambiar a una rama utilizando --just-- el número, incluso si eso requiere llamar a un script Para ejemplo:
switch_branch 1178
y el script/solución debe hacer lo siguiente
- -a git branch (encontrar todas las ramas local y remota en mi repositorio)
- filtro por el parámetro dado ('1178' arriba)
- extraer el nombre de la rama que git puede utilizar
- cambio a esa rama
Cuál es la forma recomendada hacerlo sin tener que realizar todos estos pasos manualmente?
Estoy usando Mac OSX, si eso importa aquí.
actualización - fiesta-it (github.com/revans/bash-it) sirve mi propósito
Welcome to Bash It!
Here is a list of commands you can use to get help screens for specific pieces of Bash it:
rails-help list out all aliases you can use with rails.
git-help list out all aliases you can use with git.
todo-help list out all aliases you can use with todo.txt-cli
brew-help list out all aliases you can use with Homebrew
aliases-help generic list of aliases.
plugins-help list out all functions you have installed with bash-it
bash-it-plugins summarize bash-it plugins, and their installation status
reference <function name> detailed help for a specific function
usando bash se puede usar 'git checkout 1178 [TAB]';) – KingCrunch
Y utilizando algo [de fantasía] (https://github.com/robbyrussell/oh-my-zsh/) [ayuda] (https://github.com/revans/bash-it/) es simplemente 'gco 1178 [TAB]' – Stefan
Realmente no funciona para mí. Encontré algunas referencias en la web para autocompletar para hash, pero eso no es lo que estoy buscando. – ramonrails