user3915365
user3915365

Reputation: 103

Git subtree cannot detect new commits in sub folder

I have a git repository like the following:

Top/
  .git
  sub1/
  sub2/
    Very big stuff

Sub1 is the only folder I want to push to Github. In the Top directory, I use the following command to push sub1:

git subtree push --prefix sub1/ origin master

But after I made new commits in sub1, the above command cannot find new commits and only tells me that every thing is up to date. In addition, the hash ID of the Top master is different from sub1 master. Also, the log history of Top is quite different from sub. Is this expected or the problem? How to fix it?

Thanks!

Upvotes: 1

Views: 53

Answers (1)

user3915365
user3915365

Reputation: 103

Finally I figured out why. I used symbol link to create this folder structure. The true above level of the Sub is not Top, but another folder. This folder contains a .git directory. So the masters of Top and sub are different.

Upvotes: 2

Related Questions