Git Setting | GitLab

CREATE SSH KEY

SSH-keygen -t rsa -C anyEmail@gmail.com

COPY PUBLIC KEY FROM DEFAULT LOCATION

cat id_rsa.pub or type id_rsa.pub

ADD SSH KEY ON GITHUB/GITLAB

copy public key to ssh along with title

CHECK CONNECTED WITH GITHUB/GITLAB THROUGH SSH OR NOT

SSH -T git@gitlab.com

****************************************************

git init

git add .

git commit -m “message”

git status

git log

git remote add origin <server_repo_url>

git push -u origin master

git clone <server_repo_url>

git remote -v

 

*************************************

CONFIGURATION FOR MULTI GIT ON SAME DEVICE

==> Create config file inside “.ssh”

==> Copy following code for multi git account – (for 2 account)

Host gitlab.com
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_rsa

Host gitlab-office.com
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_rsa_office

Leave a Reply

Your email address will not be published. Required fields are marked *