User Guide: A Free and Open Source Distributed Version Control System
User Guide: A Free and Open Source Distributed Version Control System
User Guide
January, 2018
2
What is Git Service?
Git (https://git-scm.com) is the most commonly used open source distributed version
control system. Git is distributed, so the local copy is fully equivalent to the original repository
and enables users to commit offline. The service ‘git.cse.iitkgp.ac.in’ is configured to provide a
reliable git repository to the department. A web based ‘github’ like interface called ‘gitlab’ is
provided to maintain the projects more effectively.
1. Name
2. Supervisor’s Name (for non-faculty login)
3. Email Id
4. Preferred username
User will get a confirmation mail once the account is created containing the username
and password. User will have to change the password provided on the first login.
Creating a Project
To create a project, login to the git.cse.iitkgp.ac.in and click on the Create a project link
shown below.
Enter project name and description and select visibility level as shown below.
3
The following screen appears if the project is created successfully.
Change the protocol from the dropdown and select SSH. Please note the complete URL
which is required to setup the client. For example, a project test is created under the user
testuser and the repository path is shown below.
4
Deploying SSH key
Open project and click on the settings button as shown below.
Click on the Expand button in the Deploy keys section as shown below.
5
Copy the contents of the id_rsa.pub received from the client and paste it in the key box.
Enter a title for reference. Check Write access allowed check box if you want to allow this client
to push the changes to the repository. Click Add key button to add the key to the project
repository.
If the key is successfully added, the key appears in the Deploy keys section as shown below.
6
Configuring Linux Client
Install package git-core in the client system.
Example:
Ubuntu: sudo apt-get install git-core
Centos: yum install git-core
Open terminal and setup git global variable for one time only.
Note: The user.name and user.email variable is for the user who will be using the client
system. This name and email will appear in the log of repository.
cat ~/.ssh/id_rsa.pub
If you see a string starting with ssh-rsa you already have an SSH key pair
and you can skip the key generate portion.
Select the default options and press enter to complete the process.
Send the generated file ( ~/.ssh/id_rsa.pub ) to the project administrator assigning into the
project.
Once the key is deployed in the project and you have received the project URL, you can
now either clone the project or add existing code the project.
7
Clone a project
Change the current directory where you want to keep the project.
git clone [email protected]: testuser/test.git
cd test
Now, you can add or modify any file. To commit the changes to the repository user the
following command.
The above command ‘git push –u origin master’ pushes the master branch to the
project repository.
cd existing_folder
git init
git remote add origin [email protected]:testuser/test.git
git add .
git commit -m "comment"
git push -u origin master
8
Configuring Windows Client
https://git-scm.com/download/win
Start the installation procedure and make sure that the following settings are checked during
installation.
9
Keep all other default options as it is and finish the installation.
notepad %homepath%\.ssh\id_rsa.pub
If you see a string starting with ssh-rsa you already have an SSH key pair
and you can skip the key generate portion.
Select the default options and press enter to complete the process.
Once the key is deployed in the project and you have received the project URL, you can now
either clone the project or add existing code the project.
Clone a project
Change the current directory where you want to keep the project.
git clone [email protected]:testuser/test.git
cd test
Now, you can add or modify any file. To commit the changes to the repository user the
following command.
The above command ‘git push –u origin master’ pushes the master branch to the
project repository.
10
Add existing folder to the repository
cd existing_folder
git init
git remote add origin [email protected]:testuser/test.git
git add .
git commit -m "comment"
git push -u origin master
11