Working with git
https://gitlab.mi.hdm-stuttgart.de
provides an interface creating a new Git
project. This involves:
-
Creating an empty new project itself.
-
Adding fellow project users for participation.
>git clone git@gitlab.mi.hdm-stuttgart.de:goik/vcintro.git
Cloning into 'vcintro'...
warning: You appear to have cloned an empty repository.
>cd vcintro/ >vim Readme.md >git add Readme.md |
# Initial project description. Will be extended when adding more assets. |
EDITOR=vim git commit Readme.md |
Adding Readme file in Markdown format
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
#
# Initial commit
#
# Changes to be committed:
# new file: Readme.md |
>git push
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 306 bytes | 306.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To gitlab.mi.hdm-stuttgart.de:goik/vcintro.git
* [new branch] master -> master
>mvn --batch-mode -e archetype:generate -Dversion=0.9 \ > -DgroupId=de.hdm_stuttgart.mi.sd1 \ > -DartifactId=first -DarchetypeGroupId=de.hdm_stuttgart.mi \ > -DarchetypeArtifactId=mi-maven-archetype-quickstart -DarchetypeVersion=1.2.1
>find first/ -type f first/.gitignore first/src/test/java/de/hdm_stuttgart/mi/sd1/AppTest.java first/src/main/java/de/hdm_stuttgart/mi/sd1/App.java first/src/main/resources/log4j2.xml first/pom.xml
> git status On branch master Your branch is up to date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) first/ nothing added to commit but untracked files present (use "git add" to track)
>git add `find first/ -type f`
>git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: first/.gitignore
new file: first/pom.xml
new file: first/src/main/java/de/hdm_stuttgart/mi/sd1/App.java
new file: first/src/main/resources/log4j2.xml
new file: first/src/test/java/de/hdm_stuttgart/mi/sd1/AppTest.java
>git status On branch master Your branch is up to date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: first/.gitignore new file: first/pom.xml new file: first/src/main/java/de/hdm_stuttgart/mi/sd1/App.java new file: first/src/main/resources/log4j2.xml new file: first/src/test/java/de/hdm_stuttgart/mi/sd1/AppTest.java
EDITOR=vim git commit -a |
Adding a Maven project.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
# new file: first/.gitignore
# new file: first/pom.xml
# new file: first/src/main/java/de/hdm_stuttgart/mi/sd1/App.java
# new file: first/src/main/resources/log4j2.xml
# new file: first/src/test/java/de/hdm_stuttgart/mi/sd1/AppTest.java
|
>git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
>git push
Counting objects: 22, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (22/22), 3.31 KiB | 1.10 MiB/s, done.
Total 22 (delta 0), reused 0 (delta 0)
To gitlab.mi.hdm-stuttgart.de:goik/vcintro.git
32da2ff..4e19142 master -> master
>git status ... Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: Readme.md
git checkout -- Readme.md
>git status Your branch is up to date with 'origin/master'. nothing to commit, working tree clean
>git pull remote: Enumerating objects: 10, done. remote: Counting objects: 100% (10/10), done. remote: Compressing objects: 100% (6/6), done. remote: Total 6 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (6/6), done. From gitlab.mi.hdm-stuttgart.de:goik/vcintro 3751344..83bd7b9 master -> origin/master Updating 3751344..83bd7b9 Fast-forward Readme.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)