2014-04-14 11 views
7

Ho installato git congit autosetuprebase non funziona?

git config --global branch.autosetuprebase always 

e sembra ok nel mio ~/.gitconfig di file:

[branch] 
    autosetuprebase = always 

Eppure, quando faccio

git pull 

si esibisce una fusione (ho tolto società dati specifici):

From gitlab:***/*** 
    8fd1d96..0d064a3 master  -> origin/master 
* [new tag]   *** -> *** 
Merge made by the 'recursive' strategy. 

Perché non esegue rebase? Si noti che l'unica cosa che ha tirato da remoto è un tag e un cambiamento di codice minore in un file non è cambiato a livello locale ...

Edit: Ho la versione git 1.8.4.5

modificare: questo è il mio locale .git/config di file:

[core] 
     repositoryformatversion = 0 
     filemode = true 
     logallrefupdates = true 
[branch "master"] 
[remote "origin"] 
     url = [email protected]:***/***.git 
     fetch = +refs/heads/*:refs/remotes/origin/* 
[branch "master"] 
     remote = origin 
     merge = refs/heads/master 
+0

ha controllato il file di configurazione locale .git. la sta sovrascrivendo? –

+0

@SukhmeetSingh: l'ho aggiunto alla mia domanda ... non sovrascrive l'opzione autosetuprebase. –

+0

Forse ti sei perso la parte in 'git help config' che dice" Quando viene creato un nuovo ramo con git branch o git checkout che tiene traccia di un altro ramo ... ". Non penso che "autosetuprebase" influenzerà retroattivamente i rami già presenti nel repository (come 'master'). Dovrai modificarli manualmente ... – twalberg

risposta

9

L'opzione branch.autosetuprebase in git interessa solo rami creati dopo che è stato impostato. Dalla pagina manuale (git help config):

branch.autosetuprebase 
     When a new branch is created with git branch or git checkout that tracks another branch, this variable 
     tells Git to set up pull to rebase instead of merge (see "branch.<name>.rebase"). When never, rebase is ... 

Per rami già esistenti, ad esempio master, c'è git config branch.master.rebase true, che può essere programmato per più rami/repository se necessario.