-
Notifications
You must be signed in to change notification settings - Fork 38
Using TCoffee on Github
- If
~/.ssh/id_rsa
exists you are fine otherwise you have to create a SSH key by usingssh-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.
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.
Fetch other users commits by pulling them from the remote repository using the pull command:
git pull
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
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.
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>
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>