{"thread":{"id":"16871","subject":"Strange large push operation.","startedAt":"2008-12-26T12:23:50Z","lastAt":"2008-12-26T14:48:47Z","messageCount":2,"participants":["Brice Figureau","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"98726","messageId":"4954CCD6.5000105@daysofwonder.com","threadId":"16871","inReplyTo":null,"subject":"Strange large push operation.","fromName":"Brice Figureau","fromEmail":"brice+git@daysofwonder.com","sentAt":"2008-12-26T12:23:50Z","receivedAt":"2008-12-26T12:23:50Z","isPatch":false,"sender":{"key":"brice+git@daysofwonder.com","avatar":null},"body":"Hi,\n\nI'm a git user since about a year, but I can't say I'm really familiar \nwith its internals. I am using git v 1.5.6.5\n\nI have a quite large bare remote repository (around 1GiB, about 86k \nobjects), and I have a clone on my development computer (which was \ncloned a long time ago). I use ssh to push/pull between those repositories.\n\nAbout 2 months ago, we created a remote branch (let's call it 'branch') \nand pursued development on this branch and also on master, with a few \nregular merge points from master to 'branch'.\n\nTwo days ago, I wanted to start developping a new feature, and as such \ncreated a local branch from this branch, which we'll call 'newbranch'. I \ncherrypicked a couple of old (4 months) commits  that were in another \nlocal branch, and then added more small commits (about 10 sloc of \nchanges on it) on top of these.\n\nThen I wanted to push this newbranch as a remote branch with:\n$ git push origin newbranch:refs/heads/newbranch\n\nand obtained the following output:\nCounting objects: 12767, done.\nCompressing objects: 100% (3816/3816), done.\nwriting objects:   8% (935/11682), 2.40 MiB | 324 KiB/s\n^C\n\nI stopped the push because I don't get why there are so much objects to \nsend while the diff between newbranch and branch is only 5 small commits \n  (and it obviously wants to push a large part of the history).\n\nIs there a way to check what objects are sent to origin and why?\nWhat could be the cause of the issue?\nWhat's wrong with those repositories?\n\nI tried to git gc both repositories, I also git fsck both repositories \n(and found 5 unreachables objects in the local one, should I care?). I \nalso upgraded the remote git to latest 1.6.0.6 but this didn't change \nanything. I also tried --thin but that didn't change anything.\n\nSo what should I do to push only the changes between branch and newbranch?\n\nMany thanks for any answer,\n--\nBrice Figureau\n"},{"id":"98733","messageId":"slrngl9rmf.r7h.sitaramc@sitaramc.homelinux.net","threadId":"16871","inReplyTo":"4954CCD6.5000105@daysofwonder.com","subject":"Re: Strange large push operation.","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2008-12-26T14:48:47Z","receivedAt":"2008-12-26T14:48:47Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2008-12-26, Brice Figureau <brice+git@daysofwonder.com> wrote:\n\n> Then I wanted to push this newbranch as a remote branch with:\n> $ git push origin newbranch:refs/heads/newbranch\n\nI'd have just said \"git push origin newbranch\" :-)\n\n> and obtained the following output:\n> Counting objects: 12767, done.\n> Compressing objects: 100% (3816/3816), done.\n> writing objects:   8% (935/11682), 2.40 MiB | 324 KiB/s\n> ^C\n\n> I stopped the push because I don't get why there are so much objects to \n> send while the diff between newbranch and branch is only 5 small commits \n>   (and it obviously wants to push a large part of the history).\n\nYes but you didn't actually say that the master has \"branch\"\n-- perhaps it isn't as uptodate as you thought it was...?\nOr perhaps there was a rebase or something that changed a\n*lot* of stuff.\n\nTry \"git log -n 1 branch\" on both machines to see if they\npoint to the same hash.\n\n[Additionally, I'm not really sure if that progress is a\nworst case estimate or a real estimate...]\n\n> Is there a way to check what objects are sent to origin and why?\n\nMy all-time favourite git command is \"bundle\" [which should\ntell you I work a lot with disconnected repos!]\n\nTry \"git bundle create /tmp/temp.bdl branch..newbranch\" then\nsee how big that temp file is.  That'll be about what goes\nto the other side (assuming the other side has the same hash\nfor \"branch\").\n\nYou could even take it to the other side and do the\nfollowing:\n    git ls-remote temp.bdl  # shows refs in bundle\n    git fetch temp.bdl one-of-the-refs-in-the-bundle\n    git merge FETCH_HEAD # merge it into current branch\n\n> What could be the cause of the issue?\n\ncan't say.  Try the following commands also to get a birds\neye view of the various branches on both sides\n    git fetch   # update your idea of what's on remote\n    git branch -a -v\n\nI also like\n    git log --graph --pretty=oneline --abbrev-commit --decorate --all\nwhich I've aliased to \"lg\"\n\n> (and found 5 unreachables objects in the local one, should I care?). I \n\nNope.  Lots of reasons to have unreachable objects...\n"}]}