0

Have a git infrastructure that consists of one top repo with several subrepos. Then we have a Jenkins infrastructure that takes a specific top-repo-branch to execute a pipeline on it.

Now I have committed and pushed code to a custom branch in one of the subrepos.

Naturally I'd like to test the jenkins pipeline with my custom code without merging into master or develop first.

Therefore how do I create a top-repo-branch that contains default branches in all repos (usually develop) except for that one repo I have worked on, where it should instead have my custom branch checked out?

AlexGeorg
  • 967
  • 1
  • 7
  • 16

1 Answers1

1

Unless I'm missing something, it's just a regular branch :

# starting from top repo :
git checkout -b newbranch

cd subrepo/
git fetch
git checkout <target branch> # or git merge, or edit files and commit+push,
                             # or anything ...

# go back to your top repo, and commit this new state :
git add subrepo
git commit
LeGEC
  • 46,477
  • 5
  • 57
  • 104
  • Yeah somehow I expected some more complex procedure and I lacked the keywords to google that right (subrepos are usually referred to as submodules). Thank you! – AlexGeorg Dec 03 '20 at 15:47