Skip to content

Using TCoffee on Github

Paolo Di Tommaso edited this page Jun 18, 2014 · 3 revisions

Configure SSH

  • If ~/.ssh/id_rsa exists you are fine otherwise you have to create a SSH key by using ssh-keygen
  • Copy the public key file content ~/.ssh/id_rsa.pub
  • Go to your Github account SSH setting page
  • Click the "Add SSH key" button, copy the copied key and save it.

Clone the T-Coffee repository

Cloning a repository is the operation of creating a working copy of the remote repository on your computer.

  • Move in the folder where you want to create your T-Coffee working project
  • Enter the following command:
    git clone [email protected]:cbcrg/tcoffee.git [target directory]

Replace [target directory] with the folder name you want to be created, by default tcoffee is used.

Update your repository

Fetch other users commits by pulling them from the remote repository using the pull command:

    git pull

Check your changes

In order the files to checked or added use the following command in the project root (or any subfolder):

git status

Even better, use the following command to view the changes in your code you are going to commit:

git difftool 

Commit your changes

Using Git, commit is a two steps process, before you have to create the set of files to be committed, or stage the changes as they say, and then you can commit them.

This means that you have to tell Git what files you have modified, added, moved or deleted by using the following commands:

git add <file names>
git rm <file name(s)>
git mv <source name(s)> <target name(s)>

You may need to repeat these as many times as are the files added/modified/deleted, wildcard can be used.

When you have done, finalize the commit by entering the following command:

    git commit -m '<your commit message>'

By using the -a command line options, you can commit all the modified files:

   git commit -a -m '<your commit message>'

Please note: the above command do not commit new or deleted files.

Share your changes

Git commits are local to your repository, if you want to share them with other users you have to push you commits to the remote repository using following command:

git push

###Create and switch branch

Branches are what make Git different. By default you works in the master branch. In order to create a new branch and switch to it, use the following command:

    git checkout -b <branch name>

To see the current branch, use the command git branch.

When you created a new branch you are free to change/add/delete file(s) and commit changes as you need as explained above.

When you want to switch back to the master branch (or any other), use the following command:

   git checkout <branch name>

Compare changes

You can compare the changes in your working copy with the current latest commit using the command:

    git diff 

Campare two different branches using the command below:

    git diff <branch x> <branch y>