Git: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Thomas (Diskussion | Beiträge)
 
(19 dazwischenliegende Versionen von 5 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
=git server=
=Übersicht=
==create user and group==
[[Datei:Git.png|500px]]
*groupadd dev
*useradd -G dev -d /home/gituser -m -s /bin/bash gituser
*passwd gituser
==mkdir and init empty git==
*su - gituser
*mkdir project.git
*cd project.git/
*git --bare init


=git client=
 
==copy id_rsa.pub to the git server==
*[[gitlab client]]
*ssh-copy-id gituser@git-server:
*[[git remote]]
==create own project directory==
*[[git server]]
*mkdir my-project
*[[git client]]
*cd my-project/
*[[etckeeper]]
==git init and show status==
*[[gitlab]]
*git init
*[[gitlab client]]
*git status -s
*[[gitweb]]
==create a new file==
*[[git handling]]
*echo -e '#!/bin/bash\necho hallo welt' > silly-prog.sh
*[[git iwatch]]
*chmod +x silly-prog.sh
*[[git Readme]]
==show status again==
*[[github]]
*git status -s
?? silly-prog.sh
==add the whole folder==
*git add .
*git status -s
A  silly-prog.sh
==commit and show log==
*git commit -m 'Initial commit'
[master (root-commit) 2790f58] Initial commit
  1 file changed, 2 insertions(+)
  create mode 100755 silly-prog.sh
*git log
commit 2790f58a6d84cf07eb3ff3774be9583d1c2834a5
Author: Thomas Will <thomas.will@xinux.de>
Date:  Wed Dec 20 16:20:44 2017 +0100
    Initial commit
==set the git server (to do only once)==
*git remote add origin gituser@git-server:project.git
==push to the master==
*git push origin master
<pre>
Counting objects: 3, done.
Writing objects: 100% (3/3), 250 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To gituser@git-server:project.git
* [new branch]     master -> master
</pre>


=links=
=links=

Aktuelle Version vom 24. April 2023, 11:31 Uhr