0

I have a git repository which consists of separate projects.Inside the repository I have individual projects like SAP, REST, BANK, Help,Angular.

Whenever I need to pull the code of individual project, i am getting code from the entire repository and also it makes sense from the behavior of git. Is there any alternate to fetch the individual project code and push it again to the repository?

2 Answers 2

1

The easiest way seems to be to have a repo per project.

Submodules may be an alternative. You could have:

  • One Git repo for each of your projects
  • One Git repo to reference each of them as submodules

This approach would let you keep your current filesystem. However, it's not rare to read about Git users saying submodules are difficult to use.

Sign up to request clarification or add additional context in comments.

1 Comment

I wouldn't advise submodules, or any of the alternatives, unless the projects are related to each other. Separate repositories are the way to go.
0

You should be using multiple repositories. Period.

If your going to be stubborn about it though, what you can do is move each separate project into a separate branch in the repository. Then, when you want to work on another project you simply switch your head to another branch.

However, you won't be able to do this when you have modified files. You must stage and commit them before switching your branch.

So again, I highly recommend using multiple repositories.

Cheers :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.