This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
linux:git [2020/06/05 10:05] – [Basic usage] tmade | linux:git [2024/04/16 16:49] – [Commands] tmade | ||
---|---|---|---|
Line 11: | Line 11: | ||
git init # | git init # | ||
- | git config --global user.name "Your Name" | + | |
+ | | ||
git config user.name "Your Name" | git config user.name "Your Name" | ||
- | git status | + | git status |
+ | git tag --list | ||
+ | git tag #show tags | ||
+ | git branch | ||
git add file #Add file " | git add file #Add file " | ||
+ | git rm --cached myfile | ||
git add . #Add all files in working directory | git add . #Add all files in working directory | ||
git commit -m " | git commit -m " | ||
Line 22: | Line 27: | ||
git checkout ID file # | git checkout ID file # | ||
git diff #Show diff/ changes | git diff #Show diff/ changes | ||
+ | git reset --hard HEAD~1 | ||
+ | git reset --hard HEAD~2 | ||
+ | git reset --hard | ||
+ | git checkout -b branch-name | ||
+ | tag = read only branch nie wieder veränderbar/ | ||
+ | git tag --list | ||
+ | git branch --list | ||
+ | git checkout < | ||
+ | git checkout -b < | ||
+ | git log -- path/ | ||
+ | | ||
+ | Tag: Readonly version of master (version). Tags give the ability to mark specific points in history as being important. | ||
+ | |||
+ | Revert: | ||
+ | git reset --hard commit-ID | ||
+ | git commit -m " | ||
+ | | ||
+ | |||
+ | ====scripts==== | ||
+ | |||
+ | Push: | ||
+ | < | ||
+ | root@kmaster:/ | ||
+ | #/bin/bash | ||
+ | |||
+ | read -p " | ||
+ | echo " | ||
+ | |||
+ | git add . | ||
+ | git commit -m " | ||
+ | #git commit -m update | ||
+ | git push -u origin master | ||
+ | </ | ||
==== Konfiguration ==== | ==== Konfiguration ==== | ||
Line 55: | Line 93: | ||
eval $(ssh-agent -s) | eval $(ssh-agent -s) | ||
ssh-add / | ssh-add / | ||
- | git remote add gitlab git@git.local: | + | git remote add gitlab git@git.local: |
- | git remote add origin ssh:// | + | git remote add origin ssh:// |
+ | git remote set-url origin ssh:// | ||
git remote | git remote | ||
git remote -v | git remote -v |