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

Re: Advice regarding inherited git repository

From
DDanielle <dsavir.h@gmail.com>
Date
Jan 7, 2016, 08:40 UTC
Message-ID
<loom.20160107T093305-483@post.gmane.org>
In-Reply-To
<20160106082022.GA19117@sigill.intra.peff.net>
Show 11 quoted lines
> You probably should create a sandbox branch, for your own sanity.
> Because git is distributed, each separate repository is implicitly a
> branch. So if you did something like:
> 
>   1. Commit all the changes on the main site to "master". Push the
>      result to some common remote.
> 
>   2. Commit all the changes in the sandbox to its "master". Do _not_
>      push to the remote.
> 
>   3. Pull the changes from the remote into the sandbox. If they're 
worth
Show 5 quoted lines
>      adding to the main site, push them up. If not, leave them there.
> 
> That works; "master" in the sandbox has the experimental changes, but
> you don't have to push them anywhere.  However, you are one accidental
> "git push" away from sending all of those experimental features to 
your
> remote "master". So it's easy enough to make step 1.5 "git checkout -b
> sandbox-cruft" in the sandbox repository, so git knows not to ever 
push
Show 11 quoted lines
> it to "master".
> 
> In general, I'd also say you may benefit from splitting the changes in
> each repository into as many separate logical commits as you can (and
> possibly even to separate topic branches that you can merge
> independently). Given that you inherited this, that's _probably_ too
> much work. But if you do want to try it, I recommend "git add -p" for
> picking out individual hunks.
> 
> -Peff
> 
Thanks for answering!

I've done the above, but it caused some problems, some of which I haven't solved yet. What I have now is a master branch with the site in both repositories; and in the sandbox an additional devel branch with the changes done. I want to split the devel branch into the actual features being explored, and then merge each into master and push when done. The main trouble with that seems to be the settings.php file, which should be backed up but certainly shouldn't go from one site to another. Removing it from the repository caused some problems, even when keeping a local cache for some reason (it got lost when switching branches and gave me a bad moment until I figured it out). Any suggestions?

Add -p will certainly help in the feature branches, thanks for suggesting it!

Previous: Jeff King
Message 2 of 2 in “Re: Advice regarding inherited git repository”
  1. Jeff KingJan 6, 2016
  2. DanielleJan 7, 2016

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.