|
7 years ago | |
---|---|---|
.. | ||
README.md | 7 years ago |
First of all you will have to configure git locally in your laptop:
Open a terminal and run the following git global commands (put your name and email):
git config --global user.name "Domingo Manubens-Gil" git config --global user.email "domingo.manubens@bsc.es"
If it is the first time you try to enter in Gogs click on “Forgot my password?” in https://earth.bsc.es/gitlab/profile/password/edit Then you will receive an email and you should follow the link and put a new password. This password will be used for your git clone(s), pull(s) and push(s).
Update your e-mail address in https://earth.bsc.es/gitlab/profile Remember to use “Cas” to log in.
After completing this step you will need to ask access to the git_tutorial project. Send an email to the GitLab administrators asking access to the Earth Sciences Test group.
To start working you need to create a clone, called afterward “working copy” of the git_tutorial project from Gitlab in your home (or folder of your choice):
git clone https://earth.bsc.es/gitlab/test/git_tutorial.git
It will ask for your username and password and you will see output like this:
Cloning into 'git_tutorial'... remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. Checking connectivity... done.
It has created a 'git_tutorial' folder and you can browse into it:
cd git_tutorial
Git clone allows you to specify parameters such as the target folder. If you don't specify it the working copy will be named as the project.
Hidden inside a 'working copy' resulting from a git clone there is a special '.git' directory that contains internal objects needed by git.
dmanuben@bscearth308:~/tutorials/git_tutorial> ls .git/ branches description hooks info objects refs config HEAD index logs packed-refs
It is hidden because you are not supposed to worry at all of internals of '.git'. When you type regular git commands like those in this tutorial, git, transparently writes stuff like indices, references, branch information there.
When you are in a working copy you can use regular unix-like commands such as ls, touch, cp, vi, etc. Additionally you can use whatever git commands, for instance: git status
git status
The outputs tells you in what branch you are on. By default (if you have not specified in the clone) it clones the master branch.
On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean
Git status is very important. It's recommendable to use it every now and then to know the status of your branch.
Moreover you can check the history of changes by using git log command: git log
git log
The outputs is a list of what has been changed recently, in reverse chronological order. It tells the author of the change, when it was made and the log message given.
commit eab1f5f77c
Author: Domingo Manubens-Gil domingo.manubens@bsc.es
Date: Fri Dec 4 15:19:11 2015 +0100
Initial commit for greetings functions
commit 50920a3d04
Author: Domingo Manubens-Gil domingo.manubens@bsc.es
Date: Thu Dec 3 19:04:16 2015 +0100
Add readme