Re: Questions on local clone and push back

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 30, 2014, at 12:43 AM, Arshavir Grigorian <grigorian@xxxxxxxxx> wrote:

> 1) is this a good approach to achieving what I need

If you do not intend to track the parent projects in Git, then yes - that is a good approach.

With that said, I recommend tracking each parent project in its own Git repository, and track the shared code in yet another Git repository, and link them using submodule references.

> 2) I was getting an error when I tied to run "git push" about the branch being checked out and

What's the error when you use the more explicit syntax, `git push <remote> <branch>`?  Depending on configuration, simply `git push` might not have all the information it needs to work.

> 3) how do I selectively push / merge only certain commits back to the "source" repository / branch?

You can't.  When pushing, pulling, or merging, you can only deal with subsections of the commit graph.

With that said, you can rebuild parts of the commit graph using selected commits.  Then, that result can be pushed, pulled, or merged.

In my experience, you want to avoid picking and choosing commits in the shared repository for each parent project.  Maintaining the shared repository is difficult enough.  I advise that you find a way to make your shared code configurable for each project, such that you can have one "master" branch for all, and each project just uses or configures the code differently.  With that said, try to keep your configurations to a minimum (within reason) - in general, the more configurations you have, the more difficult the shared library will be to maintain.

Hope that helps,
 - Andrew

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]