2012-07-19 21 views
5

Sto lavorando con due rami test e principale.Git Push non funzionante

Quindi, essendo il principale ramo, ho fatto:

git merge test 

e tutto è andato bene. Tutte le modifiche sono state unite.

Poi spingerlo al telecomando principale, ho fatto:

git push 

ma sembra che non ha fatto nulla, ha detto:

Total 0 (delta 0), reused 0 (delta 0) 
To [email protected]:Company/My-App.git 
b878c9d..0dc7fbe main -> main 

non credo che dovrebbe mostrare zero sopra come totale se la spinta è andata bene.

Come posso spingere il mio ramo principale ?

+0

cosa ti aspetti? hai fatto una spinta e te lo dico. Se premi di nuovo, ti dirà "Tutto aggiornato". –

+0

Giusto, ma non mi aspettavo di vedere tutti gli zeri qui: Total 0 (delta 0), riutilizzato 0 (delta 0) – Myxtic

+0

hai controllato il repo tramite la pagina github? vai su https://github.com/Company/My-App/commits/main, hai visto il tuo ultimo commit? –

risposta

3

Ciò significa che git non scrive alcun oggetto. Ciò accade quando tutti gli oggetti sono già in remoto e quando si uniscono basta spostare l'etichetta 'main' sull'ultimo commit. Ho appena fatto un test rapido per dimostrare che:

~/workspace 
    $ git clone [email protected]:korin/test_merge.git 
    Cloning into 'test_merge'... 
    remote: Counting objects: 3, done. 
    remote: Total 3 (delta 0), reused 0 (delta 0) 
    Receiving objects: 100% (3/3), done. 

    ~/workspace 
    $ cd test_merge 
    ~/workspace/test_merge 

    $ git co -b test 
    Switched to a new branch 'test' 

    ~/workspace/test_merge 
    $ echo 'a' > a 

    ~/workspace/test_merge 
    $ git add . 

    ~/workspace/test_merge 
    $ git ci -m 'a' 
    [test 9953350] a 
    1 file changed, 1 insertion(+) 
    create mode 100644 a 

    ~/workspace/test_merge 
    $ git push --set-upstream origin test 
    Counting objects: 4, done. 
    Delta compression using up to 4 threads. 
    Compressing objects: 100% (2/2), done. 
    Writing objects: 100% (3/3), 273 bytes, done. 
    Total 3 (delta 0), reused 0 (delta 0) 
    To [email protected]:korin/test_merge.git 
    * [new branch]  test -> test 
    Branch test set up to track remote branch test from origin. 

    ~/workspace/test_merge 
    $ g co master 
    Switched to branch 'master' 

    ~/workspace/test_merge 
    $ g merge test 
    Updating f5e0184..9953350 
    Fast-forward 
    a | 1 + 
    1 file changed, 1 insertion(+) 
    create mode 100644 a 

    ~/workspace/test_merge 
    $ g push 
    Total 0 (delta 0), reused 0 (delta 0) 
    To [email protected]:korin/test_merge.git 
     f5e0184..9953350 master -> master 
+0

g sta per git, è solo un alias –

+0

Questo ha senso. Grazie mille per la spiegazione :) – Myxtic