7

I am working with two branches test and main.

So, being on the main branch, I did :

git merge test

And everything went fine. All the changes were merged.

Then to push it to the remote main, I did :

git push

But it seems like that did nothing, it said :

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

I don't think it should be showing zero above as Total if the push did go through fine.

How can I push my main branch ?

5
  • what you expect? git made a push and tell you that. If you do push again it will tell you "Everything up-to-date". Commented Jul 19, 2012 at 18:50
  • Right, but I wasn't expecting to see all zeros here : Total 0 (delta 0), reused 0 (delta 0) Commented Jul 19, 2012 at 18:53
  • did you check you repo via github page? just go to github.com/Company/My-App/commits/main, did you see your last commits ? Commented Jul 19, 2012 at 18:59
  • Yup, that shows my commits and so it means the push did go through. But why would it show all zeros in : Total 0 (delta 0), reused 0 (delta 0) ? Commented Jul 19, 2012 at 19:10
  • It would be easier to understand with a 'modified x' .. Commented Aug 29, 2015 at 19:12

1 Answer 1

6

That just means git does not write any objects. That happens when all objects are already on remote and when you merge you just move label 'main' to the latest commit. I just made a quick test to prove that:

    ~/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
Sign up to request clarification or add additional context in comments.

1 Comment

g stands for git, it just an alias

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.