I want to upgrade to a newer version of a CMS whose development is tracked in Git. Since the CMS update is in the new year, every file gets the copyright date bumped from 2011 to 2012.
I could visually inspect and stage each file that just gets the copyright bump using git gui. However, it seems like I should be able to tell git to stage only those files whose only change is:
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc.
There are a few thousand files that changed, but the vast majority of these received no other change than this specific line. I want to stage and commit this simple copyright date bump, then take a closer look at those files receiving more substantive changes.
This purpose could be accomplished by two possible means:
- Stage and commmit only those files that just contain this change.
- Stage and commit just this change from all files.
Is either possible? Thanks in advance!
git add --patch
(random blog link, better ones to be found with googling) and see whether (1) you can access the individual patches in a script and (2) whether you can provide responses from a script.git stash
to stash all your changes, then re-apply the copyright bump, add everything, commit, and thengit stash pop
to restore your changes?