Trying to understand what Travis CI does and when it should be used

I am very new to Git and I am planning to contribute to some open-source project on GitHub after discovering a small error in it. Upon forking it and fixing the error, I purposed a pull request and I noticed this showing up:

Failed — The Travis CI build failed

  • phpstorm looking for ssh key in wrong directory
  • Git merge: take everything from “theirs” branch
  • Why is '#define alloc_nr(x) (((x)+16)*3/2)' macro used in many cache.h files?
  • Managing Ruby On Rails with multiple regions
  • How to commit a partial file (hunks) to git in pycharm
  • in Xcode 4 how to associate a project to the local Git repository I set up?
  • Looking into the details I discovered it was caused by Could not find .travis.yml, which made perfect sense since I had not signed in to Travis Cl with and add .travis.yml to the repository.

    This is my first time hearing about Travis and what that is known as continuous integration. And it sounds pretty cool so in order to learn more about it, I looked it up on Wikipedia.

    Travis CI is a hosted, distributed continuous integration service
    used to build and test projects hosted at GitHub. Travis CI automatically detects when a commit has been made and pushed to a GitHub repository that is using Travis CI, and each time this happens, it will try to build the project and run tests. This includes commits to all branches, not just to the master branch.

    My current understanding of Travis CI is that what it does is automatically pushing the project upon git commit -am ".." and I don’t quite understand some part of it.

    1. By building the project and run tests, what tests is it going to run? And how is it going to “build” the project? (like compiling it to binary?)

    2. It states that “This includes commits to all branches” – but what if I don’t want to commit to all branches?

    3. Is it alright if I don’t use Travis Cl at all? Under what circumstances is it best to use it (or it must be used)?

  • Most efficient way to keep a fork up-to-date
  • How to use a parenthesis character inside a command substitution inside a bash snippet inside a git configuration alias?
  • How to decompose git pull <REMOTE> <BRANCH> into a fetch + merge?
  • Gerrit Trigger on multiple SCM in jenkins not working
  • What do ++ and +- mean in a Debian diff file?
  • Xcode 4 build schemes screwed up every time I change branches in Git
  • 2 Solutions collect form web for “Trying to understand what Travis CI does and when it should be used”

    The simpilest way to explain Travis CI is that it runs your program’s tests every time you commit to GitHub (This can be configured in many ways, and you can always disables builds on some branches). The point of this is that you can often discover very quickly if your commit broke something, and fix it before it becomes a problem. I would reccomend running Travis CI on every GitHub repo that you have unit tests in and is using a programming language supported by Travis CI. Since setting up Travis CI is very easy, I don’t normally see a good reason not to use it, unless you don’t care if you have passing tests in your program. Feel free to leave a comment if you have any more questions. You can read more about Travis CI here.

    As you have already discovered what is Travis-CI, I would directly point to the questions you have.

    By building the project and run tests, what tests is it going to run? And how is it going to “build” the project? (like compiling it to binary?)

    In the .travis.yml a file you’re specifying your OS, the programming language, your repo branch, the project file name and other details. By reading this file, Travis-CI will use the specific compilers which installed on their server to compile our code. Probably they will have the same mechanism like we have for Github. For the first time, they might pull the code [if we have specified specific branches they might pull the code from those branches only]. Also, we have authenticated to use our account with Travis-CI, whenever we make a commit, there should be some notification should fire to Travis-CI server thus it will be recognized as a commit and it will start compiling.


    It states that “This includes commits to all branches” – but what if I don’t want to commit to all branches?

    You can specify different branches or the master branch. And it should only compile the specific branches specified in .travis.yml file.


    Is it alright if I don’t use Travis Cl at all? Under what circumstances is it best to use it (or it must be used)?

    Yes, it’s alright. Not a big deal. But what benefits you will be missing by not using this easy to integrate engine with your repo. Everytime you commits it may possible that it miss something and it couldn’t compile because of a code. How will you know? Thus, you should use Travis-CI.


    I have written a blog post which you can read to know, what is Travis-CI, Continuous Integrations and how to linked Travis-CI with your Github Repo. I have written it for a Swift repository.

    Git Baby is a git and github fan, let's start git clone.