This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:git [2020/06/05 10:05] – [Basic usage] tmade | linux:git [2024/04/16 17:38] (current) – tmade | ||
---|---|---|---|
Line 10: | Line 10: | ||
==== Commands ==== | ==== Commands ==== | ||
- | git init | + | git init |
- | git config --global user.name "Your Name" | + | git config --global user.email " |
- | git config user.name "Your Name" | + | git config --global user.name "Your Name" |
- | git status | + | git config user.name "Your Name" |
- | git add file | + | git status |
- | git add . #Add all files in working directory | + | git tag --list |
- | git commit -m " | + | git tag #show tags |
- | git log #Show history | + | git branch |
- | git reset --hard | + | git add file |
- | git revert ID #Revert to change from ID - other changes after not affected | + | git rm --cached myfile |
- | git checkout ID file | + | git add . #Add all files in working directory |
- | git diff | + | git commit -m " |
+ | git log #Show history | ||
+ | git reset --hard | ||
+ | git revert ID #Revert to change from ID - other changes after not affected | ||
+ | git checkout ID file | ||
+ | git diff | ||
+ | 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:/ | ||
+ | #/ | ||
+ | |||
+ | 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 |