0

I'm currently working towards migrating a large application to a build server. Every push to our Git repository will trigger a new build that will build, tests - all with the help of a variety of scripts located in my project.

As of now I'm making modifications to my scripts locally, then pushing them to Git each time. As you would have guessed, this is making my commit log incredibly jam packed with a lot of minor edits that have identical commit messages.

This is what I'm doing after each minor change -

git add .;git add -A;git commit -m "Trigger Bamboo build.";git push

Ideally, I would like to merge all pushed commits related to my build changes into one.

How can I help curb this problem?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
self.
  • 1,612
  • 4
  • 18
  • 35
  • 1
    What are these changes that you're making? Build script changes that you want to test in your continuous integration environment? – Magnus Bäck May 21 '15 at 12:18

1 Answers1

1

Add a tag to the last non-testing commit

git tag backup

Then continue to work like you did

git add .;git add -A;git commit -m "Trigger Bamboo build.";git push

Once you have found a Bamboo setup that works for you, revert your local changes by going back to the commit you tagged above

git reset --hard backup

Finally, revert your remote as well (assuming you are allowed to use git push -f)

git push -f

EDIT:

If your commit were actually meaningful and you don't want to discard them, which would happen using the above described method, you could use interactive rebasing

git rebase -i backup

and change pick to squash for all but the last entry in the list. This will merge all commit between the tag backup and the current HEAD into one commit. Details can be found in the git book or in this [tutorial by Atlassian]

UPDATE:

You could also configure Bamboo use schedule builds:

enter image description here

nils
  • 2,424
  • 1
  • 17
  • 31