Skip to content
Snippets Groups Projects
Commit 4bfd6853 authored by Goik Martin's avatar Goik Martin
Browse files

completing git intro

parent d7753385
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -2159,5 +2159,219 @@ Value 2147483645 is not prime.
</imageobject>
</mediaobject>
</figure>
<figure xml:id="sd1_fig_media_gitClone">
<title>Cloning a git project</title>
<screen>&gt;git clone git@gitlab.mi.hdm-stuttgart.de:goik/vcintro.git
Cloning into 'vcintro'...
warning: <emphasis role="red">You appear to have cloned an empty repository</emphasis>.</screen>
</figure>
<figure xml:id="sd1_fig_media_gitCdIntoProject">
<title>Enter project folder, add <filename>Readme.md</filename></title>
<informaltable border="0">
<tr>
<td valign="top"><screen>&gt;cd vcintro/
&gt;vim Readme.md
&gt;git add Readme.md</screen></td>
<td valign="top"><screen># Initial project description.
Will be extended when adding more assets.</screen></td>
</tr>
</informaltable>
</figure>
<figure xml:id="sd1_fig_media_gitCommitChangeset">
<title>Committing change set</title>
<informaltable border="0">
<tr>
<td valign="top"><screen>EDITOR=vim git commit Readme.md </screen></td>
</tr>
<tr>
<td valign="top"><screen><emphasis role="red">Adding Readme file in Markdown format</emphasis>
# 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</screen></td>
</tr>
</informaltable>
</figure>
<figure xml:id="sd1_fig_media_gitPush">
<title>Push to upstream repository</title>
<screen>&gt;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)
<emphasis role="red">To gitlab.mi.hdm-stuttgart.de:goik/vcintro.git</emphasis>
* [new branch] master -&gt; master</screen>
</figure>
<figure xml:id="sd1_fig_gitCreateMaven">
<title>Inserting a Maven project</title>
<screen>&gt;mvn --batch-mode -e archetype:generate -Dversion=0.9 \
&gt; -DgroupId=de.hdm_stuttgart.mi.sd1 \
&gt; -DartifactId=first -DarchetypeGroupId=de.hdm_stuttgart.mi \
&gt; -DarchetypeArtifactId=mi-maven-archetype-quickstart -DarchetypeVersion=1.2
</screen>
<screen>&gt;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</screen>
</figure>
<figure xml:id="sd1_fig_gitInsertMavenStatus_1">
<title>git status 1</title>
<screen>&gt; git status
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "<emphasis role="red">git add &lt;file&gt;</emphasis>..." to include in what will be committed)
<emphasis role="red">first/</emphasis>
nothing added to commit <emphasis role="red">but untracked files present</emphasis> (use "git add" to track)</screen>
</figure>
<figure xml:id="sd1_fig_gitAddMavenFiles">
<title>Adding Maven files to repository</title>
<screen>&gt;<emphasis role="red">git add `find first/ -type f`</emphasis>
&gt;git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD &lt;file&gt;..." 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</screen>
</figure>
<figure xml:id="sd1_fig_gitInsertMavenStatus_2">
<title>git status 2</title>
<screen>&gt;git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD &lt;file&gt;..." 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</screen>
</figure>
<figure xml:id="sd1_fig_media_gitCommitMavenProjectFiles">
<title>Commit Maven project files</title>
<informaltable border="0">
<tr>
<td valign="top"><screen>EDITOR=vim git commit -a</screen></td>
</tr>
<tr>
<td valign="top"><screen><emphasis role="red">Adding a Maven project.</emphasis>
# 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
</screen></td>
</tr>
</informaltable>
</figure>
<figure xml:id="sd1_fig_gitInsertMavenStatus_3">
<title>git status 3</title>
<screen>&gt;git status
On branch master
<emphasis role="red">Your branch is ahead of 'origin/master' by 1 commit.</emphasis>
(use "git push" to publish your local commits)
nothing to commit, working tree clean</screen>
</figure>
<figure xml:id="sd1_fig_media_gitPushMaven">
<title>Push to upstream again</title>
<screen>&gt;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)
<emphasis role="red">To gitlab.mi.hdm-stuttgart.de:goik/vcintro.git</emphasis>
32da2ff..4e19142 master -&gt; master</screen>
</figure>
<figure xml:id="sd1_fig_media_gitUndoChanges">
<title>Reverting changes</title>
<screen>&gt;git status
...
Changes not staged for commit:
(use "git add &lt;file&gt;..." to update what will be committed)
(use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
modified: Readme.md
</screen>
<screen>git checkout -- Readme.md</screen>
<screen>&gt;git status
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean</screen>
</figure>
<figure xml:id="sd1_fig_media_gitPull">
<title>Pull changes from upstream</title>
<screen>&gt;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 -&gt; origin/master
Updating 3751344..83bd7b9
Fast-forward
Readme.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)</screen>
</figure>
</section>
</appendix>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment