Last Updated: September 27, 2019
·
1.877K
· tadas_t

What has changed since the last deploy?

Oftentimes before deploying applications I want to see the summary of changes since the last deploy. For example, it is useful to know if there were any changes to the DB scheme and I need to run the DB migrations. The simplest thing I could come up with was doing a git diff between the production master and local master like that:

git fetch production master && git diff master production/master --stat

The --stat flag shows the summary of the changes rather than the full diff. Its easy to grep for a specific filename you are interested in. For convenience I suggest you add an alias to your .bashrc/.zshrc etc.

alias whatsnew='git fetch production master && git diff master production/master --stat'

Thanks to David with whom we collectively developed this.

3 Responses
Add your response

@vladimiroff Your command is doing something completely different.
You are comparing branches on your local repository, not the deployed branch with your local one.

production is a remote, not a branch!

over 1 year ago ·

Another way to do it is to tag on deployment. This has the advantage of working for all the differences between deployments in the past as well. For Ruby and Capistrano, for example, i wrote a gem that does that.

Http://github.com/mydrive/capistrano-deploytags/

Hope that serves as an example.

over 1 year ago ·

If you capistrano and rails then this is another option to achieve that: https://coderwall.com/p/gzp8ag

over 1 year ago ·