Shared development with centralized remote.

Figure 674. Centralized remote repository Slide presentation

See multi+remote/shared git:

  1. Create empty remote repository on gitlab.mi.hdm-stuttgart.de.

  2. Connect local repository to remote

  3. push or pull content


Figure 675. Step 1: Create remote repository Slide presentation
Step 1: Create remote repository

❶

Each project requires a unique but otherwise arbitrary name within the git repository server.

❷

You decide about your project's general visibility.

This default restriction does not apply for project members being added subsequently.

❸

As the hint states: Leave this project empty for being able to push your content later.


Figure 676. Step 2: Retrieve remote repository address Slide presentation
Step 2: Retrieve remote repository address

❶

These settings must be applied at your local project's side. They are being required for later identification of individual project member commits.

❷

Depending on your personal choice two protocols for connecting your project are on offer:

  • ssh: Requires configuration of a public/private key pair for authentication.

  • https: »Traditional» authentication based on user name and password.


Figure 677. Step 2: Connect to remote repository Slide presentation
git remote add origin ❶ https://gitlab.mi.hdm-stuttgart.de/goik/gitintro.git

❶

origin is an alias for our remote repository https://gitlab.mi.hdm-stuttgart.de/goik/gitintro.git.


Figure 678. Step 3: Push local to remote Slide presentation
git push --set-upstream origin ❶ master
Username for 'https://gitlab.mi.hdm-stuttgart.de': goik ❷
Password for 'https://goik@gitlab.mi.hdm-stuttgart.de': 
Counting objects: 5, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 507 bytes | 507.00 KiB/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To https://gitlab.mi.hdm-stuttgart.de/goik/gitintro.git
 * [new branch]      master -> master ❸
Branch 'master' set up to track remote branch 'master' from 'origin'.

❶

origin representing our project's URI https://gitlab.mi.hdm-stuttgart.de/goik/gitintro.git.

❷

User authentication credentials being required for remote repository access authorization.

❸

Local branch «master» being connected to remote branch «master».


Figure 679. Step 3: Pull remote to local Slide presentation
> git pull ❶
Username for 'https://gitlab.mi.hdm-stuttgart.de': goik ❷
Password for 'https://goik@gitlab.mi.hdm-stuttgart.de': 
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
From https://gitlab.mi.hdm-stuttgart.de/goik/gitintro ❸
   733e541..ffff092  master     -> origin/master
Updating 733e541..ffff092 ❹
Fast-forward
 Math.java | 10 ++++++++-- ❺
 1 file changed, 8 insertions(+), 2 deletions(-)

❶

Replace local repository by remote repository.

❷

User credentials.

❸

Log info: Local master branch has been replaced by remote master branch

❹

Log info: Switch to topmost (HEAD) remote repository commit:

>git log
commit ffff092c51324efad06f0639191f1372ba98e9f8 (HEAD -> master, origin/master)
Author: Martin Goik <goik@hdm-stuttgart.de>
Date:   Sun May 26 10:41:22 2019 +0200

    Adding method commentAdding method comment

commit 733e541a3c3daa19e789f80c6174f19417b2247e
Author: Martin Goik <goik@hdm-stuttgart.de>
Date:   Sat May 25 17:59:46 2019 +0200 ...

❺

Change related statistics.


Figure 680. Alternative: Create remote, then clone Slide presentation
  1. Create new possibly non-empty project at https://gitlab.mi.hdm-stuttgart.de.

  2. > git clone https://gitlab.mi.hdm-stuttgart.de/goik/gitintro.git
    Cloning into 'gitintro'...
    Username for 'https://gitlab.mi.hdm-stuttgart.de': goik
    Password for 'https://goik@gitlab.mi.hdm-stuttgart.de': 
    remote: Enumerating objects: 5, done.
    remote: Counting objects: 100% (5/5), done.
    remote: Compressing objects: 100% (4/4), done.
    remote: Total 5 (delta 0), reused 0 (delta 0)
    Unpacking objects: 100% (5/5), done.