Create a GitHub Merge Batch File

By  on  

Before I start updating my local clone of the MooTools More or Core libraries, I need to update to the most current version on GitHub. Call me lazy, but I'm tired of typing the commands lines into msysgit all the time. I've created a batch file that does the work for me.

The Batch Script

git fetch git://github.com/mootools/mootools-core.git master:coco
git merge coco

What I'm doing is:

  1. Going out to GitHub, grabbing the current "Core", and putting it into a branch called "coco."
  2. Merging it with my current local copy.
  3. Pushing it to my GitHub account.

I know that's not a lot to type, but this script lets me move things along a tiny bit faster. The "push" updates my repository at GitHub right away too. It's also probably important to mention that my operating system is Windows XP.

Recent Features

  • By
    9 Mind-Blowing Canvas Demos

    The <canvas> element has been a revelation for the visual experts among our ranks.  Canvas provides the means for incredible and efficient animations with the added bonus of no Flash; these developers can flash their awesome JavaScript skills instead.  Here are nine unbelievable canvas demos that...

  • By
    5 Ways that CSS and JavaScript Interact That You May Not Know About

    CSS and JavaScript:  the lines seemingly get blurred by each browser release.  They have always done a very different job but in the end they are both front-end technologies so they need do need to work closely.  We have our .js files and our .css, but...

Incredible Demos

  • By
    Camera and Video Control with HTML5

    Client-side APIs on mobile and desktop devices are quickly providing the same APIs.  Of course our mobile devices got access to some of these APIs first, but those APIs are slowly making their way to the desktop.  One of those APIs is the getUserMedia API...

  • By
    Firefox Marketplace Animated Buttons

    The Firefox Marketplace is an incredibly attractive, easy to use hub that promises to make finding and promoting awesome HTML5-powered web applications easy and convenient. While I don't work directly on the Marketplace, I am privy to the codebase (and so...

Discussion

  1. do once:
    git remote add mootools git://github.com/mootools/mootools-core.git

    then do:
    git pull mootools master

    done.

  2. Ha Chris . .beat me too it!

    And yeah, the above would be a lot easier

    /Matt

  3. Thanks for the tip Chris and Matt!

  4. Way to automate, David :)

  5. Laziness FTW!

  6. I think this is mildly dangerous. Whenever you merge w/ another codebase you should ensure that the chnaged files are updating things you want. But it’s not uncommon for the changes to create merge conflicts. Having the push in your batch file means that you’re going to try and push those changes without the opportunity to review them.

    For what it’s worth, I prefer to use rebase instead of merge when I can…

  7. @Aaron Newton: Good call. Removed from my local file.

  8. You could make a little tutorial on how to checkout, merge, commit stuff to the mootools project hehe, i would be one to appreciate it.
    Thanks for sharing.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!