git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Parallell Development / Switching to GIT

From
Jeff King <peff@peff.net>
Date
Jun 28, 2009, 18:47 UTC
Message-ID
<20090628184714.GA8634@sigio.peff.net>
In-Reply-To
<B81058949321C8439B9D742F5F8D8FCA01A75C1D@hpserver.intranet.local>
On Sun, Jun 28, 2009 at 07:51:26PM +0200, Patrick Neuner - Futureweb.at wrote:
Show 9 quoted lines
> 1) What if I only want to merge a specific file/directly, but not the
> whole branch, is there a way?
> [...]
> The reason is, that external developers will only commit to
> development branch.  They are working on new features, and sometimes
> some small bugfixes, or design templates.  Those need to be merged
> separately, and we try to not have more branches. As developers can
> access our testserver and then see what they have done and test
> functionality.

For the situation you describe, it is not about merging a specific _file_, but rather you want to pick specific _commits_ from the development branch that have the bugfixes (or whatever) that you need, and merge the changes introduced by those commits (but not the rest of the history).

And that is easy to do; it is called cherry-picking, and you can use "git cherry-pick" to pick specific commits from development to master.

Show 6 quoted lines
> 2) We are using gitosis to give external developers access to the
> branches and have some kind of access restriction.  But we are only
> able to limit push rights, not pull rights. In most cases, that's not
> a problem, if they see master And development, but sometimes (like for
> external designers), we might want them to only be able to checkout
> some directories.

There are two ways you can split access, and one will work but the other will not.

In git, you generally cannot split your data by _tree_. That is, you cannot say "here is all of the history for the master branch, but you are only allowed to look at some subset of the files." Because at a fundamental level, git is about tracking changes to the _whole_ set of files over time, and it makes the assumption that if you have commit X, which points to tree Y, which points to files A, B, and C, that you will have the data for X, Y, A, B, and C in your repository.

However, if you have your data split by _history_, that might work. That is, if you have a "master" branch and a "development" branch, you can in theory say "you may look at the history of master, but not of development". The usual way to do that is to actually keep "master" and "development" in two different repositories, and only grant read permission in the filesystem for the "master" one (which obviously implies doing your reading over something authenticated, like ssh).

Hope that helps, -Peff

Previous: Patrick Neuner - Futureweb.atNext: Patrick Neuner - Futureweb.at
Message 4 of 13 in “Parallell Development / Switching to GIT”
  1. Patrick NeunerJun 25, 2009
  2. Andreas EricssonJun 25, 2009
  3. AW: Parallell Development / Switching to GITPatrick Neuner - Futureweb.at, Jun 28, 2009
  4. Jeff KingJun 28, 2009
  5. AW: Parallell Development / Switching to GITPatrick Neuner - Futureweb.at, Jun 28, 2009
  6. David AguilarJun 28, 2009
  7. Andreas EricssonJun 29, 2009
  8. Peter HarrisJun 29, 2009
  9. AW: AW: Parallell Development / Switching to GITPatrick Neuner - Futureweb.at, Jul 2, 2009
  10. Johannes SixtJul 2, 2009
  11. AW: AW: AW: Parallell Development / Switching to GITPatrick Neuner - Futureweb.at, Jul 2, 2009
  12. Johannes SixtJul 2, 2009
  13. Jeff KingJun 30, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.