1

I have a current folder whose contents I want to push to an existing remote git repo but in a subfolder

I don't think submodules and subtree since those assume different remote repo. I have only one remote repo.

Machine A:
/home/userA/tools

I want the content of the above folder be sync to the remote repo's subfolder. e.g.

https://git.company.com/projectA/machine-scripts.git
/machineA/Scripts <--sync with the /home/ubuntu/tools above
/machineB/Scripts <--sync with different machine's /home/userB/tools

The idea is to have folder's from different machine or users have corresponding folder to single remote repo, but not necessarily following or enforcing remote repo's folder structure.

Thanks in advance.

rainman
  • 491
  • 3
  • 5
  • 1
    That's not how Git works. – iBug May 31 '19 at 12:26
  • How about making creating a new repo with the contents you want to sync to and using that as a submodule? I am not too familiar with submodules but from what I've read so far you should not have any problems using them to solve this issue. – Matthew May 31 '19 at 12:29
  • https://stackoverflow.com/search?q=%5Bgit%5D+push+one+folder – phd May 31 '19 at 13:43
  • I think the solution could work. I could also also tract the git repo in different folder and simply create a symlink. Thanks. – rainman Jun 05 '19 at 15:20

0 Answers0