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:

[alias]
	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...

Related

  1. Tips for Writing Maven Plugins
  2. Dagger DI for Spring Refuges: 10 Tips
  3. Tips For Robust Bash Scripts

Recent

Tags

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

Sitemap | Google+ | View Alex Collins's profile on LinkedIn