How to set you SSH key into Gitlab [First you need to had installed Git onto your distro]
-
Go to your terminal and issue the follow command to generate your key:
$ssh-keygen
-
Copy your public key from the route: /home/user/.ssh/id_rsa.pub
-
Then go at your gitlab profile https://gitlab.com/profile/keys/ a paste and save.
-
From the terminal test the conection by typing:
$ssh -T git@gitlab.com
and if everything was fine it has to promt –> Welcome to GitLab, @user_account! -
Set up the global credentials
git config --global user.email "youremail-account@sss.com"
git config --global user.name "gitlab-account"
- It’s done π
NOTE:
$git commit -m "adding new theme folder"
$git push origin
$git add hello-friend/
more info:
I forgot something else, when we create by the first time a new project into Gitlab, from the dashboard it will show us the following basic instructions:
- Command line instructions
You can also upload existing files from your computer using the instructions below. Git global setup
git config --global user.name "name"
git config --global user.email "email@domain.com"
- Create a new repository
git clone git@gitlab.com:user/project-name.git
cd project-name
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
- Push an existing folder
cd existing_folder
git init
git remote add origin git@gitlab.com:user/project-name.git
git add .
git commit -m "Initial commit"
git push -u origin master
if you want to add a empty folder, the general workaround is to add an empty file .gitkeep and to add it to git:
touch work/subject/.gitkeep
git add work/subject/.gitkeep
git commit -am "Add directory subject"
- Push an existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin git@gitlab.com:user/project-name.git
git push -u origin --all
git push -u origin --tags