« Previous - Version 40/45 (diff) - Next » - Current version
Alexander Refsum Jensenius, 2010-07-02 10:58 am

Common GIT tasks

The following tasks can be performed in the Terminal, as described, but parts of them can be done by UI clients :
  • The Gitter is a client in Max (Mac-Only), developped by the Jamoma team, and that will allow most of the basic features.
    There is also a standalone version of it, but we'll recommend using the version in Max for Jamoma.
  • gitx : will only allow you to commit and add branches (push and pull have to be performed via the terminal)
  • There's also a TextMate git bundle that might come in handy.

Here are the commands to use in the terminal if you don't want to use these clients or if they don't have some of these features :

How to update from Github

  • First update the main project by cd to your repository folder, and type :
    git pull
  • Next the submodules need to be updated:
    git submodule update
    This will not necessarily give you the bleeding edge latest version of all commits in all submodules, but should provide you with updates of submodules that will be consistent with the version you have for the main GIT repository.
  • If you instead want the "bleeding edge", you can use this command:
    git submodule foreach git pull
  • We noticed (even if we didn't really figure out why...), that most of the fatal errors happening when trying to push/pull/checkout could be overcome by running these 2 commands from the main repository :
    • git submodule foreach git checkout master
    • git submodule foreach git pull

How to check for differences

  • Go to the folder where you want to look for changes:
    cd Modules/Modular/
  • Get an overview of what has been changed:
    git diff --stat
  • or
    git status

How to add files and folders

  • To add a file or folder to git:
    git add [file/folder]
  • and then do the commit:
    git -m "This is my message" [file/folder]
  • After this you will have to push your changes.

How to push to GitHub

  • cd Modules/Modular/
  • mate .git/config
  • change line : url to :tap/JamomaModular.git
    (this will only work if you have been registered as a contributor first)

If you e.g. want to push from the local master branch to GitHub (origin)'s master branch, you can do:

git push origin master

A better way to do this, however, is to do

git push origin HEAD

This is better because you are simply saying to push from whatever branch you are on to that same branch on the remote (aka github or origin).

Working with branches