Back to the main page

Add new file to remote GitLab repo

Remore GitLab Project

The project sysadmins/rsync-admin has been created via web UI on https://<gitlab-hostname>

Working directory

Working directory is /home/zdudic/gitlab/rsync-admin , so change to this directory

Existing file

There is one file sync-oss-internal that you want to put under git control

Create local repo

Create new local repo with the command:
# git init

Global setup

# git config --global "Zarko Lastname"
# git config --global ""

Adding file to local repo

# git add <filename>

Commit the file to local repo

# git commit <filename>

Adding a Remote repo

# git remote add origin git@<gitlab-hostname>

Pushing to remote

Syntax: git push <REMOTENAME> <BRANCHNAME>
#  git push -u origin master 
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 1.22 KiB, done.
Total 3 (delta 0), reused 0 (delta 0)
* [new branch]      master -> master
Branch master set up to track remote branch master from origin.

The file is on remote

Back to the main page