updating software using git

If your software is version controlled using git for example, you need to version control the software update as well. For file changes, there are 3 possibilities:

a) file modified
b) file deleted
c) new file added

to handle part a) and b), we can run this code in command line

git status | grep modified: | awk '{print $3}' | xargs git add
git status | grep deleted: | awk '{print $3}' | xargs git rm

by this time, “git status” show see only the “untracked files”. manually “git add” the new files.

Note that this is only for file updates. for db updates, things can become extra complicated depending on the infrastructure.

Author: bpeh

Bernard Peh is a great passioner of web technologies and one of the co-founder of Sitecritic.net Website Design and Reviews. He works with experienced web designers and developers everyday, developing and designing commercial websites. He specialises mainly in SEO and PHP programming.