On 2015-05-09, at 2:59 PM, Michael <[email protected]> wrote:
> So here's something that I'd like to do, and I'm wondering if Git is the
> right tool for this.
>
> I have a program's config file, that is broken up into a large number of
> sections. One of them is causing a problem. All of them have been modified.
>
> ...
>
> What comes to mind as a good way to do this:
> 1. Commit the version that has too many (including the problem section) edits
> made to it, to one branch.
> 2. Start a new branch (off the parent, not that over-edited commit), and
> start that with a plain config file.
> 3. Repeat loop:
> a. Check out a copy from the branch in #1.
> b. Commit one chunk into the branch in #2.
> c. Reset the file to the version just checked in
> d. Test
>
> 4. As long as that works, each loop will test, and commit, one more section
> of edits.
>
> The problem? I don't have any idea how to check out a copy of file X from
> branch OverEdit into branch Testing.
>
> Is there a better way to do this with git? Is git the wrong tool?
Ok, I think I have a way to do this. I now want to know, is this the best way,
is there a better way, are there hidden gotchas with this?
git checkout -b Chest # Start with a new branch
git add chest_content.cfg # Put the base, unaltered config file in
git commit -m "base config file" # and save it
git checkout -b broken-all # Now, another branch for the broken set of
changes
cp ../Loot/chest_content.cfg . # Put the broken file in place
git commit . # Save the broken file into git
git checkout Chest # Back to the working branch
git checkout broken-all chest_content.cfg # Get the broken file with
everything
# This is the command I did not
know how to do
# Warning: it starts with the
whole file in index
git gui # Visually commit the lines for one segment
at a time
# First uncommit the whole file, then add
just one segment
git checkout -- chest_content.cfg # and throw away the other changes
## test test test # See if it works or breaks
Repeat those last 4 lines until it breaks; then, back out one commit.
>
> ---
> Entertaining minecraft videos
> http://YouTube.com/keybounce
>
---
Entertaining minecraft videos
http://YouTube.com/keybounce
--
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.