Set up GitLab project

März 9, 2018 - Lesezeit: 2 Minuten
On GitLab
  1.     setup an user account for free on https://gitlab.com/users/sign_in
    If you decide to use social login, don’t forget to set up an username and a password, since you will need it for pushing the project later on.
  2.     Log in and create new empty private project (no README).
  3.     Folow the next steps on your local machine
On your local command line
Git global setup
cd ~
cat .gitconfig
git config --global user.name "Hoang"
git config --global user.email "joe@hohohoho.com"
Create a new repository
git clone https://gitlab.com/<your_username>/<your_project>.git
cd <your_project>
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Existing folder
cd existing_folder
git init
git remote add origin https://gitlab.com/<your_username>/<your_project>.git
git add .
git commit -m "Initial commit"
git push -u origin master
Existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin https://gitlab.com/<your_username>/<your_project>.git
git push -u origin --all
git push -u origin --tags