[kwlug-disc] Advanced(?) Git usage question

Adam Glauser adamglauser at gmail.com
Thu Apr 17 13:23:05 EDT 2014


John, I think your question (which I'm not sure you've answered yet), boils
down to "What happens in the file system when I checkout a branch"? Am I
understanding correctly?

I think your set up is to have Apache in your XAMPP setup pointed to some
directory in your git working copy. When you issue `git checkout
rewind_xxxx`, git updates the files in your working copy so they match the
snapshot of the files a the time HEAD of that branch was committed.

So when you browse https://localhost/mysite, XAMPP goes and fetches the
files/runs the scripts as the were at commit X.

To know what this means in terms of which features are present and what
behaviour to expect, you need to have a good idea of what the commit
history. This is why everyone harps about good commit messages.

I'm confused by your message from midnight. If you `git checkout branch`,
modify indexTest.php, then `git checkout otherbranch', git should warn you
that you have uncommitted changes and refuse to change branches.

If you commit your fix, the way to apply it to the other branches is to
merge or rebase the branch with your fix on to the target branch. There is
also the option to cherry-pick just that change, in case fix-branch has
other changes that are not desired in target-branch.

As for determining the impact of the fix on the target branch, git can only
marginally help with that. As you are probably aware, git will tell you if
there have been other changes made to the particular chunks of code in the
target branch. However, if you change the behaviour of a function, git
can't help you figure out how consumers of that function will adapt to the
change. This is why good software engineering techniques from software
design to automated unit and integration testing are still important.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20140417/de23a5ab/attachment.htm>


More information about the kwlug-disc mailing list