0

I am using GitHub Desktop for Mac. I'd like to know if it is possible to add default text to commits.

For example, in the description of a commit, I'd like "[skip ci]" to be there by default in order to prevent Travis from building, unless I remove this default text, in which case Travis will then run a build.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89

2 Answers2

0

What you are describing I don;t think can be done (I am not totally sure you can change default text as I could not do it in the desktop app but I could do it via a script in my terminal). However, if you are using Travis CI you could just add a git tag and make a small configuration change to your build and that will automatically trigger a build. To do this you would need to add a git tag like such:

on:
  tags: true

Next you would need configure your build, I just created this sample:

language: nodejs

nodejs: - 5.7.1

deploy: provider: heroku strategy: git skip_cleanup: true app: myapp on: tags: true nodejs: '5.7.1' api_key: secure: yourapikeyhere=

Travis CI has a nice documentation about all the possibilities.

Dup Step
  • 218
  • 1
  • 6
  • What I need is to be able to force Travis to not run any builds unless I use a specific keyword (basically the opposite of using [skip ci]). By adding the keyword via a .gitmessage, this means I will have to edit the .gitmessage... Making it a cumbersome solution, even if working. So, no good. :/ – Idan Adar Mar 09 '16 at 15:02
  • We are attempting to modify Travis instead. No luck thus far. – Idan Adar Mar 09 '16 at 15:02
  • Ahh, let me think about that one – Dup Step Mar 09 '16 at 15:05
0

For standard git you can create a commit message template in ~/.gitmessage and tell git to use it for every commit by setting commit.template in your user config.

[commit]
  template = ~/.gitmessage

I hope that your tool will pick it up also.

Johannes Thorn
  • 902
  • 6
  • 13
  • What I need is to be able to force Travis to not run any builds unless I use a specific keyword (basically the opposite of using [skip ci]). By adding the keyword via a .gitmessage, this means I will have to edit the .gitmessage... Making it a cumbersome solution, even if working. So, no good. :/ – Idan Adar Mar 09 '16 at 15:01
  • That is a different question and I don't know enough about travis to answer it. Maybe you should create a separate question for that. But please tell me: Did my idea work for having a default Text? – Johannes Thorn Mar 09 '16 at 22:46