How to prevent from having to

clone all the folders / files in a repo ?

I just want the project I am working on to be stored locally, then push my code to the repo where the other unrelated folders / files are. in other words, I don’t want all the other unrelated folders / files in the remote repo to be displayed in my code editor which is open in the local git repo.

Or do we just have to have different repos for every separate project ?

Using a separate repo for each project is generally the idea, yes. Sometimes closely related projects (e.g. and library and an application built using that library) share one repository.

Technically you could use structure your project as subdirectories of the repository directory, but at the point where you want to commit things you’d still have to deal with everything. Also the history of everything would get mixed up, so it’s generally not a good idea.

1 Like