This is the structure of two separate Repos- Foo and Bar:
Repo[Foo]
- [branch]Foo1
- [branch]Foo2
Repo [Bar]
- [branch] Bar1
- [branch] Bar2
I wanted to add Bar/Bar2 as a branch-"Foo3" in Repo Foo. And consequently push any changes/commits made in Bar/Bar2 into Foo3 whenever I wanted to.
I did the following: (In the Foo repo dir)
git remote add Bar ../Bar
git remote update
git checkout Foo3
git merge --allow-unrelated-histories Bar/Bar2
git push --set-upstream origin Foo3
Later I added some files in Bar/Bar2, and did a git merge and git push. But what I'm seeing on the terminal is "Everything up-to-date", and the new files aren't reflected in Foo/Foo3. I have referred this question that has done this