-3

I have a master branch. Under it, I have one branch dev. Under dev, I have two different branches, library and application. This library branch has code which can be used by multiple applications in that future, so the development of that is kept separately. Is there a way to refer to that branch in my application branch? I mean, what is the best way to get content of library branch into my application branch?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Aakash Goyal
  • 1,051
  • 4
  • 12
  • 44

2 Answers2

0

This is not the purpose of branches. Branches are for storing concurrent paths of development of the same code, not for storing different code in the same repository. You should instead have two repositories, one for the library and one for the application; or put both in separate directories in the same branch of the same repository.

Adrian
  • 42,911
  • 6
  • 107
  • 99
0

@Adrian has reason in the purpose of branches. But if you want to do that (something I don't recommend), you can do:

  1. Save your branch changes:

    git add . (or what you need to add)
    git commit
    
  2. Merge your branch

    git merge library
    
Caznik
  • 49
  • 7