1

I have a project (pipeline) that is also included as a part of a larger project (aws_pipeline). For both I have two different github accounts set up. I want to work on the pipeline project from within the aws_pipeline and then push it to the pipeline git account. Could anyone describe a step-by-step procedure of how to do basic push to the pipeline remote (from within aws_pipeline)? I added pipeline remote and can see it now when I do git branch -a in aws_pipeline. Now I need to somehow add some files that I modify, commit and push without pushing anything else in the large aws_pipeline. Pretty much I want a subfolder of the aws_pipeline to work as a separate git project attached to pipeline. I need the separation but want to have also synchronization of the pipeline between itself and the aws_pipeline. Any suggestions would be greatly appreciated.

Update

To clarify more. I want to find a way to merge two folders instead of deleting - add submodule set of actions described here: Issue with adding common code as git submodule: "already exists in the index"

Update

I solved it in my case by removing the folder, adding git submodule, then manually copy-pasting the modified files into the submodule. It does seem though too clumsy way of resolving this issue. If anyone has a better solution, would be awesome to see.

Nikita Vlasenko
  • 2,837
  • 4
  • 33
  • 62
  • Did you have a look at git submodules ? – Axnyff Nov 06 '19 at 19:31
  • No, I honestly have no idea of how it should be handled. Going to look at it. – Nikita Vlasenko Nov 06 '19 at 19:42
  • Can you clone the pipeline remote somewhere else and move the content of your subfolder into it so you can have the changes. Then do the git submodule add ? – Axnyff Nov 06 '19 at 19:54
  • Maybe, will see – Nikita Vlasenko Nov 06 '19 at 19:55
  • No, I actually want to merge them, not just copy to different place - remove - add submodule - copy back... That just does not seem right – Nikita Vlasenko Nov 06 '19 at 20:08
  • It was just a suggestion to get started with the submodule if you have work left in the pipeline directory. Otherwise, just remove and add the submodule, it should work fine – Axnyff Nov 06 '19 at 20:25
  • I am not sure how to actually do that. I have a folder that is named `pipeline`, but when I try running `git submodule add https:{...}/remote-pipeline pipeline`, it writes me that the index is already present. Its obvious why it gives this error, but not so obvious how to resolve this issue by merge two code bases. – Nikita Vlasenko Nov 06 '19 at 20:46
  • There are sort of solutions here: https://stackoverflow.com/questions/12898278/issue-with-adding-common-code-as-git-submodule-already-exists-in-the-index/14815959 The only difference that I want to have is to actually be able to merge two folders (local and remote that I am adding as a `submodule`). Maybe there is just no functionality in git for this case, not sure. – Nikita Vlasenko Nov 06 '19 at 20:58

0 Answers0