Using Git
Using Git in the External Server
Whenever a user wants to use Git on the external server, it is necessary to add their project to the internal GIT server. This procedure is carried out by DSI.
Please run the following test:
1. Login to the external server, Config file
To use git, it is necessary to modify or create the .gitconfig file in your user’s home directory. You can use KWrite to edit/create the file. The file should have the following format and should be created for each user who has access to GitLab. In this file, you can adapt the name and replace ‘investa’ with your own user.
[cola]
spellcheck = false
[user]
name = Investigador A
email = investa@sxpe-bplim01.bplim.local
[gui]
editor = kwrite
2. Authenticate by ssh-key. Open a Terminal in your home folder and type:
- `ssh-keygen -t rsa -C “BPLIM git”`
- `cat ~/.ssh/id_rsa.pub`
3. Copy the resulting key to the clipboard
4. Open Firefox and navigate to https://vxpp-bplimgit.bplim.local/

Confirm that you have a secure connection and use your credentials for the external server to login.
5. In your profile go to settings and on the left-side bar click in SSH Keys and paste the contents of the clipboard in the text box on the top right corner under “Key”



Give a title, e.g., “BPLIM git”, and click in “Add key”
6. Go to Projects and create a New project, e.g., myfirst


7. Now you can clone the project

Open a Terminal in your work_area and type
git clone git@vxpp-bplimgit.bplim.local:investa/myfirst.git

You have now a new folder corresponding to your project:

8. You should now create a .gitignore file following the instructions available at https://git-scm.com/docs/gitignore
9. You are now ready to work with Git on your project
You can find here a Git tutorial