-1

My friend asked me a question:

When we develop a same Android app on github, we have 2 ways to develop in parallel:

  1. The first way is forking a new branch repository and follow the request&merge process.
  2. The second way is create a new folder in the same repository in the same repository.

For the second way, my friend said that it will be easier for his job as he can always pull all codes and merge by himself.

According to my experiences, I didn't do it and I always use branch and merge.

Why one method would be superior to the other?

I can provide a sample GitHub project with sub-folder and the project is AndroidTVLauncher.

For other projects on GitHub, as I know, they most follow the first way and use branch and merge.

Community
  • 1
  • 1
David Lin
  • 31
  • 8
  • what you mean with `(2)The second way is create a new folder in the same repositor in the same repository.` – Robdll Apr 14 '17 at 03:54
  • dear @Koop4, I mean that I can create a new folder under the original project folder. I didn't do this before and this way is suggested by my friend. – David Lin Apr 15 '17 at 11:56
  • so what does he put into that subdirectory? does he copy the project with his modifications? does he take original project as a template for some another project? – max630 Apr 16 '17 at 07:36
  • @max630, my friend said using sub-folder will be eaiser for his merge and code comparsion. – David Lin Apr 16 '17 at 13:49

1 Answers1

0

Creating a branch is always preferable to a new folder within the same repo: that is how a modern version control isolate new development efforts with code isolation: see "When should you branch?".

But don't forget that with recent versions of Git, you can clone a repo once, but checkout twice, in different folders, each one on their own branch (git worktree command).
So you can have both: a dedicated folder, for a dedicated branch.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250