RE: "groups of files" in Git?
- Date: Tue, 11 Jul 2017 13:27:01 -0400
- From: "Randall S. Becker" <rsbecker@xxxxxxxxxxxxx>
- Subject: RE: "groups of files" in Git?
On July 11, 2017 11:45 AM Nikolay Shustov wrote:
>I have been recently struggling with migrating my development workflow from Perforce to Git, all because of the following thing:
>I have to work on several features in the same code tree parallel, in the same Perforce workspace. The major reason why I cannot
>work on one feature then on another is just because I have to make sure that the changes in the related areas of the product play together well.
>With Perforce, I can have multiple changelists opened, that group the changed files as needed.
>With Git I cannot seem to finding the possibility to figure out how to achieve the same result. And the problem is
>that putting change sets on different Git branches (or workdirs, or whatever Git offers that makes the changes to
>be NOT in the same source tree) is not a viable option from me as I would have to re-build code as I re-integrate
>the changes between the branches (or whatever changes separation Git feature is used).
>Build takes time and resources and considering that I have to do it on multiple platforms (I do cross-platform development) it really denominates the option of not having multiple changes in the same code tree.
Change sets are core git functionality. When you commit, you commit a group of changes across multiple files, not single file at a time, like most legacy SCM systems. Individual features are managed typically managed using topic branches that can be switched (using checkout) rapidly, which in your case will cause a localized rebuild based on what files were swapped.
If you need something slightly different than topic branches, do multiple clones off a base integration branch. This will give you multiple working source trees. Switch each clone to its own branch and work with them locally. If you need to move changes from one branch to another, commit, push on one branch, and pull merge to the other branch.
You could also use stash to accomplish similar things, but I wouldn't.