La risposta di @Charles è corretta. Ad ogni modo ho finito per usare tante volte, soprattutto a REBASE config specifica su un progetto
* a8f9182 (HEAD -> production) production configuration
| * daa18b7 (pre) preproduction configuration
|/
| * d365f5f (local) local configuration
|/
* 27d2835 (dev) amazing new feature that will save the world
* | 56d2467 (master) boring state of the art for project
|/
che creo un nuovo comando per esso:
$ cat ~/bin/git-rebaseshot
COMMIT=$1
DEST=${2:-HEAD}
git rebase ${COMMIT}^ ${COMMIT} --onto $DEST
normalmente si desidera completare automaticamente i nomi di filiale per quel comando, quindi inserirlo di sourcing questa funzione (aggiungendo .bashrc o .profile):
_git_rebaseshot()
{
__gitcomp_nl "$(__git_refs)"
}
git completamento automatico cercherà esso
.210
è possibile utilizzare questo comando come questo:
# rebase config on prepro on actual HEAD
$ git rebaseshot prepro
# rebase config on local onto dev
$ git rebaseshot local dev
# rebase production config on master
$ git rebaseshot pro master
Quando si divide correttamente le caratteristiche, possibities sono infinite.
* a8f9182 (HEAD -> postgres) BBDD config
* a8f9182 (local) local config
* a8f9182 (debug) log level config
* a8f9182 (dev) new feature
|
Credo che questo è ciò che quilt persone piace fare.
questo comando funzionerà comunque con qualsiasi sha/ref che fornisci:
$ git rebaseshot <Feature branch> master
$ git rebaseshot <commit of XX> master
Se è possibile ribattere un numero qualsiasi di commit, perché si chiede di rideterminarne uno singolo? Se potessi fare domande in SO, vorrei chiedere qual è la differenza tra rebasing (un singolo commit) e cherry-picking. – Val
Perché non sapevo che esistesse il cherry-picking, e "Faff about on branch", "Get request for fix on different branch", "fix it", "Commit al ramo sbagliato", "D'OH! " abbastanza che la domanda fosse utile. –