4

I have a "Main" project in which I splitted a few sub directories with the subtree split command. I've made some changes to one of the splitted sub directories and now I'd like to push that to their own upstream repositories.

Normally I'd do that like this (this has worked before):

$ git subtree push --prefix=src/Shared/Util/ https://github.com/user/util.git master

But when I run this command it says:

Everything up-to-date

But it's not... I made all sorts of changes to files. I even added new ones. And those aren't there yet in my upstream repo.

Then why is Git telling me that everything is up to date when it's not? How can I fix this problem?


The command git branch -avv gives me:

$ git branch -avv
* master                  8d26a74 [origin/master: ahead 9] Merge branch 'master'
 of https://github.com/user/support
  remotes/composer/master 720acbb Added composer.json to framework
  remotes/origin/HEAD     -> origin/master
  remotes/origin/master   720acbb Added composer.json to framework
Vivendi
  • 20,047
  • 25
  • 121
  • 196
  • Are you in a branch, or are you in a detached head mode (http://stackoverflow.com/a/3965714/6309? What does `git branch -avv` returns? – VonC Apr 13 '14 at 13:39
  • @VonC Sorry I'm not really sure how to tell if I'm in branch or detached head. Quite new to git. I did run the command you suggested. I edited my post with the result of that. --- In thise case ***framework*** is the "main" project. And ***support*** and ***utils*** are the subtree projects. – Vivendi Apr 13 '14 at 14:15
  • Try running `git subtree split` in order to see the commits that supposedly would be pushed to the subtree remote. Do that creates any new set of commits? If so, can you see your changes in those commits? – Maic López Sáenz Apr 14 '14 at 06:37
  • @LopSae I thought rebuilding all the repos would fix the problem. But I was wrong. Still have this issue. I ran your command and it gives me: `1/ 5 (0)2/ 5 (1)3/ 5 (2)4/ 5 (3)5/ 5 (3)7384c97f9c42fd45ac2bbed31989f662afffa558`. I just made a simple edit to one file. – Vivendi Apr 14 '14 at 08:44
  • @Vivendi That last hash printed should be the tip of the tree created for your subtree. That commit is the one pushed when doing `git subtree push`. You could try to check if it correctly includes your last changes, or if it is already pushed somehow to your repo into the correct branch. Hopefully this will help pinpoint if the issue is on the `split` part, or the `push` part. – Maic López Sáenz Apr 14 '14 at 22:21
  • Did you ever figure this out? I'm running into the same problem. `git subtree split` recognizes my changes, but `git subtree push` says everything is up to date. I've been having no problems with subtree pushing then for no apparent reason it started acting just as you describe above. – Ghopper21 Apr 10 '17 at 21:52
  • Update -- turns out everything was working with the `git subtree push` -- the problem was my git client (SourceTree) wasn't refreshing its history properly, so it seemed like the commit hadn't been pushed to the subtree repo, when in fact it had been. – Ghopper21 Apr 10 '17 at 22:02

0 Answers0