Git tips: git xpush

I'd recently been suffering from builds failing because people (including myself) had been pushing changes that they hadn't run tests on, or where un-pulled changes had broken their code.

As we use Maven, there's a simple solution to this, git aliases.

You can add the following to ~/.gitignore:

	xpush = !sh -c 'git pull --no-edit && mvn clean install && git push'

Now, when you do "git xpush" git pulls any new changes down, rebuilds the app (running the tests) and pushes the changes to the repo.

Alex Collins

Java technical lead and solutions architect in London for the UK IT industry for over ten years. more...


  1. A Reliable Push Button Release Pattern
  2. Dagger DI for Spring Refuges: 10 Tips
  3. Tips for Writing Maven Plugins
  4. Tips For Robust Bash Scripts



concurrency (4)   docker (6)   gist (13)   java (44)   jmeter (3)   junit (7)   links (14)   maven (15)   oped (8)   performance (5)   plaf (14)   ruby (3)   selenium (7)   software (10)   spring (6)   swing (15)   testing (21)   tips (4)   tomcat (3)   unix (6)   web (4)  

Sitemap RSS LinkedIn