{"thread":{"id":"22552","subject":"Fwd: how to apply patch?","startedAt":"2010-02-07T02:05:39Z","lastAt":"2010-02-07T13:00:29Z","messageCount":4,"participants":["Matt Di Pasquale","Tay Ray Chuan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"133844","messageId":"13f0168a1002061805o5d64c05cy9d8f0190a8f37feb@mail.gmail.com","threadId":"22552","inReplyTo":"13f0168a1002061720t93ff6aew3420a41a547549d8@mail.gmail.com","subject":"Fwd: how to apply patch?","fromName":"Matt Di Pasquale","fromEmail":"liveloveprosper@gmail.com","sentAt":"2010-02-07T02:05:39Z","receivedAt":"2010-02-07T02:05:39Z","isPatch":false,"sender":{"key":"liveloveprosper@gmail.com","avatar":"https://gravatar.com/avatar/0c4196519680e2a9fd1d36ed00f95e0890a42d33652623fe1c305be1ea0d6f0a?d=mp&s=160"},"body":"I have a development version & a production version of my website.\nThere are a few essential differences between them that I want to\nalways stay different (like path constants, etc). When I make changes\non the dev version and test it out and they work and am ready to copy\nthem to the production (www) version, how do i do that without\nannihilating the essential differences that i want to keep? I was\nthinking of creating a patch or branch or something with the\ndifferences. Then, copy dev to pro, then reapply/rebase the essential\ndifferences to pro that got wiped out. if i rebase though, i want to\nbe able to rebase again on the next edit.\nwhat's a good way to do this?\n\nMy dir structure:\n\nexample.com\n  www  # production site\n  dev   # development site\n\nVia DreamHost control panel:\nwww.example.com points to example.com/www/\ndev.example.com points to example.com/dev/\n\nWhy don't I just have a branch called dev? Maybe I should... Advice?\n(Anyway, it's nice to be able quickly, simultaneously open\ncorresponding files from both www & dev in textmate.\nI guess I could do that with like git show master:www/index.html |\nmate or something, but then it opens in a new textmate window. it's\njust not the same. I guess there's always the possibility of editing\nwww/index.html when I actually want to be editing dev/index.html, but\nthen again, it's also possible to be editing the wrong branch.)\n\nMy .git/config file has the following aliases for deployment:\n\n# deploy dev\nddev = !rsync -avi --copy-unsafe-links --exclude='*.DS_Store'\n--delay-updates --delete-after --delete-excluded -e ssh\n~/Sites/example.com/dev/ acani@acani.com:Sites/example.com/dev/\n\n# deploy www\ndpro = !rsync -avi --copy-unsafe-links --exclude='*.DS_Store'\n--delay-updates --delete-after --delete-excluded -e ssh\n~/Sites/example.com/www/ username@example.com:Sites/example.com/www/\n\nThanks!\n\nMatt\n"},{"id":"133850","messageId":"be6fef0d1002062040x6556b73fvb2a62a85fe21ec9e@mail.gmail.com","threadId":"22552","inReplyTo":"13f0168a1002061805o5d64c05cy9d8f0190a8f37feb@mail.gmail.com","subject":"Re: how to apply patch?","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-07T04:40:03Z","receivedAt":"2010-02-07T04:40:03Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Sun, Feb 7, 2010 at 10:05 AM, Matt Di Pasquale\n<liveloveprosper@gmail.com> wrote:\n> [snip]\n> Then, copy dev to pro, then reapply/rebase the essential\n> differences to pro that got wiped out. if i rebase though, i want to\n> be able to rebase again on the next edit.\n> what's a good way to do this?\n\nyou could put this in your config:\n\n  [remote local]\n    url = .\n    fetch = dev\n  [branch \"pro\"]\n    remote = local\n    rebase = true\n\nWhen you're wish to incorporate your latest changes in \"dev\" into\n\"pro(duction)\",\n\n  $ git checkout pro #assuming you're not already on \"pro\"\n  $ git pull\n\nRepeat ad nauseum.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"133855","messageId":"13f0168a1002062206p8da7dd0n5f1b353c33b344f3@mail.gmail.com","threadId":"22552","inReplyTo":"be6fef0d1002062040x6556b73fvb2a62a85fe21ec9e@mail.gmail.com","subject":"Re: how to apply patch?","fromName":"Matt Di Pasquale","fromEmail":"liveloveprosper@gmail.com","sentAt":"2010-02-07T06:06:10Z","receivedAt":"2010-02-07T06:06:10Z","isPatch":false,"sender":{"key":"liveloveprosper@gmail.com","avatar":"https://gravatar.com/avatar/0c4196519680e2a9fd1d36ed00f95e0890a42d33652623fe1c305be1ea0d6f0a?d=mp&s=160"},"body":"Hi Ray,\n\nThanks for your response. I don't understand how that will transfer my\nlatest changes in ./dev into ./www while preserving the fundamental\ndifferences between the 2 directories. Could you please provide some\nexplanation?\n\nAlso, is there an easy way to do something like this with a branch\ninstead of a remote? Remote doesn't make sense to me conceptually (and\nI already have a remote repo setup that I push to from master). Maybe\nI should have 2 different branches? One for dev & one for pro. How\nwould I do that?\n\nThanks,\n\n-Matt\n"},{"id":"133872","messageId":"be6fef0d1002070500p4850b847p21a0736447100050@mail.gmail.com","threadId":"22552","inReplyTo":"13f0168a1002062206p8da7dd0n5f1b353c33b344f3@mail.gmail.com","subject":"Re: how to apply patch?","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-07T13:00:29Z","receivedAt":"2010-02-07T13:00:29Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Sun, Feb 7, 2010 at 2:06 PM, Matt Di Pasquale\n<liveloveprosper@gmail.com> wrote:\n> [snip]\n> Also, is there an easy way to do something like this with a branch\n> instead of a remote? Remote doesn't make sense to me conceptually (and\n> I already have a remote repo setup that I push to from master).\n\nI'm already doing this with branches. It's true that I used a remote\nconfiguration, but the remote configuration (\"[remote local]\") says\nthat we're treating the local repository as the remote repo (\"url =\n.\") and to \"fetch\" the dev branch (into FETCH_HEAD).\n\n(btw, instead of '[remote local]' it should be '[remote \"local\"]'.)\n\nI do this so that you can just type \"git pull\" without specifying the\nbranch, unlike when using git-rebase.\n\n> Maybe\n> I should have 2 different branches? One for dev & one for pro. How\n> would I do that?\n\nYou should.\n\nYour history for the two branches would look like this:\n\na---b---c dev\n         \\\n          A---B---C pro\n\n(if you're reading this in a non-fixed width font, pro branches off at \"c\".)\n\nThe commits in uppercase (A, B, C) are those that are applied onto dev\n- for example, changing file paths, configuration, etc.\n\nLet's say you've made some changes onto your dev branch. To update\nyour production site, you would rebase your pro changes onto the dev\nbranch (using the config and commands in the previous message), so\nthat you get this history:\n\na---b---c---d---e dev\n                 \\\n                  A'---B'---C' pro\n\n(pro branches off at dev's tip, \"e\".)\n\nYou have to keep in mind several issues. For example, if you're\nupdating file paths, when new files are added in the dev branch, you\nneed to update the pro side to modify the file paths in those files. I\nwas also assuming your dev branch fast-forwards cleanly, or else the\nrebase fumbles.\n\n-- \nCheers,\nRay Chuan\n"}]}