Git client handling: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| (14 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 9: | Zeile 9: | ||
*git status | *git status | ||
<pre> | <pre> | ||
| − | + | ... | |
| − | |||
Untracked files: | Untracked files: | ||
| − | + | ... | |
| − | |||
sux.txt | sux.txt | ||
| + | ... | ||
| + | </pre> | ||
| − | |||
| − | |||
==add whole directory== | ==add whole directory== | ||
*git add . | *git add . | ||
==status tracked== | ==status tracked== | ||
| + | *git status | ||
| + | <pre> | ||
| + | ... | ||
| + | Changes to be committed: | ||
| + | ... | ||
| + | new file: sux.txt | ||
| + | ... | ||
| + | </pre> | ||
| + | |||
| + | ==transfer to local repo== | ||
| + | *git commit -a -m sux-ver1 | ||
| + | ==transfer from local to remote repo== | ||
| + | *git push --set-upstream origin master | ||
| + | =change file= | ||
| + | ==change== | ||
| + | *echo sauhund >> sux.txt | ||
| + | ==status modified== | ||
*git status | *git status | ||
<pre> | <pre> | ||
On branch master | On branch master | ||
Your branch is up-to-date with 'origin/master'. | Your branch is up-to-date with 'origin/master'. | ||
| − | Changes to be committed | + | Changes not staged for commit: |
| − | (use "git | + | (use "git add <file>..." to update what will be committed) |
| + | (use "git checkout -- <file>..." to discard changes in working directory) | ||
| + | |||
| + | modified: sux.txt | ||
| − | + | no changes added to commit (use "git add" and/or "git commit -a") | |
</pre> | </pre> | ||
| − | =transfer to local repo= | + | ==transfer to local repo== |
| − | *git commit -a -m sux- | + | *git commit -a -m sux-ver2 |
| − | =transfer from local to remote repo= | + | ==transfer from local to remote repo== |
*git push --set-upstream origin master | *git push --set-upstream origin master | ||
| + | =reset last changes= | ||
| + | ==show== | ||
| + | *git show | ||
| + | <pre> | ||
| + | commit 86d9c437dd69944e47cbfc4a45b6c26661b3d9c5 | ||
| + | Author: Thomas Will <thomas.will@xinux.de> | ||
| + | Date: Tue Mar 6 14:13:17 2018 +0100 | ||
| + | |||
| + | sux-ver2 | ||
| + | |||
| + | diff --git a/sux.txt b/sux.txt | ||
| + | index 636af66..942e0e3 100644 | ||
| + | --- a/sux.txt | ||
| + | +++ b/sux.txt | ||
| + | @@ -1 +1,2 @@ | ||
| + | Hallo Welt | ||
| + | +sauhund | ||
| + | </pre> | ||
| + | ==reset to last commited state== | ||
| + | *git checkout -- sux.txt | ||
| + | ==reset to earlier state== | ||
| + | *git log | ||
| + | <pre> | ||
| + | commit 86d9c437dd69944e47cbfc4a45b6c26661b3d9c5 | ||
| + | Author: Thomas Will <thomas.will@xinux.de> | ||
| + | Date: Tue Mar 6 14:13:17 2018 +0100 | ||
| + | |||
| + | sux-ver2 | ||
| + | |||
| + | commit cc390a18080a8f37793cefc4c76eaa1193139104 | ||
| + | Author: Thomas Will <thomas.will@xinux.de> | ||
| + | Date: Tue Mar 6 14:07:09 2018 +0100 | ||
| + | |||
| + | sux-ver1 | ||
| + | |||
| + | </pre> | ||
| + | *git reset --hard cc390a18080a8f | ||
| + | *git push -f origin master | ||
| + | ==change one file to old state== | ||
| + | *git checkout 006becfb22b -- init.d/firewall | ||
Aktuelle Version vom 6. März 2018, 15:06 Uhr
last changes detailed
- git show
all changes
- git log
new file
create
- echo Hallo Welt > sux.txt
status untracked
- git status
... Untracked files: ... sux.txt ...
add whole directory
- git add .
status tracked
- git status
... Changes to be committed: ... new file: sux.txt ...
transfer to local repo
- git commit -a -m sux-ver1
transfer from local to remote repo
- git push --set-upstream origin master
change file
change
- echo sauhund >> sux.txt
status modified
- git status
On branch master Your branch is up-to-date with 'origin/master'. 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: sux.txt no changes added to commit (use "git add" and/or "git commit -a")
transfer to local repo
- git commit -a -m sux-ver2
transfer from local to remote repo
- git push --set-upstream origin master
reset last changes
show
- git show
commit 86d9c437dd69944e47cbfc4a45b6c26661b3d9c5
Author: Thomas Will <thomas.will@xinux.de>
Date: Tue Mar 6 14:13:17 2018 +0100
sux-ver2
diff --git a/sux.txt b/sux.txt
index 636af66..942e0e3 100644
--- a/sux.txt
+++ b/sux.txt
@@ -1 +1,2 @@
Hallo Welt
+sauhund
reset to last commited state
- git checkout -- sux.txt
reset to earlier state
- git log
commit 86d9c437dd69944e47cbfc4a45b6c26661b3d9c5
Author: Thomas Will <thomas.will@xinux.de>
Date: Tue Mar 6 14:13:17 2018 +0100
sux-ver2
commit cc390a18080a8f37793cefc4c76eaa1193139104
Author: Thomas Will <thomas.will@xinux.de>
Date: Tue Mar 6 14:07:09 2018 +0100
sux-ver1
- git reset --hard cc390a18080a8f
- git push -f origin master
change one file to old state
- git checkout 006becfb22b -- init.d/firewall