Tag Archives: git

Git Setup instructions

Setup your account and your project:

  1. Create a google account
  2. Use that account to login to gitlab.com
  3. Create a new project
  4. Note the URL of the project displayed by gitlab.
  5. Optionally add members (other users) to that project as developers

Install git client to a linux (debian) machine:

  1. sudo apt-get install xclip
  2. sudo apt-get install git
  3. ssh-keygen -t rsa -C “blabla@hohomail.com”
  4. xclip -sel clip < ~/.ssh/id_rsa.pub

Step 3 has created a public and a private key to the computer to be used from SSH. The paths are:

  • private key file: ~/.ssh/id_rsa
  • public key file: ~/.ssh/id_rsa.pub

Step 4 has copied the public key to clipboard buffer. You have to login to gitlab and paste that key to your profile’s SSH keys.

Configure GIT global variables:

  1. git config –global user.name “John Doe”
  2. git config –global user.email “blabla@hohomail.com”

Now you are ready to either create a new repository or clone an existing one:

To create a new repository:

  1. git init
  2. git remote add origin git@gitlab.com:blabla/projectsth.git
  3. git add .
  4. git commit -m “blabla comment”
  5. git push -u origin master

To clone an existing one:

  1. git clone git@gitlab.com:blabla/projectsth.git
  2. touch newfile
  3. git add newfile
  4. git commit -m “blabla comment”
  5. git push -u origin master