Common GIT tasks

The following tasks can be performed in the Terminal, as described, but parts of them can be done by Git_clients

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 commit -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 :jamoma/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

Merging