fix: Typos korrigiert.
This commit is contained in:
parent
af855b024b
commit
858e6c5661
1 changed files with 27 additions and 29 deletions
|
|
@ -1,26 +1,26 @@
|
||||||
# Git Commands
|
# Git Commands
|
||||||
|
|
||||||
## Random ideas
|
## Random Ideas
|
||||||
|
|
||||||
[Kart: DVC for geospatial and tabular data. Git for GIS](https://kartproject.org/), [Discussion](https://news.ycombinator.com/item?id=38073512#git), [Go to Post from 2023-10-30T20:40:06](https://social.lansky.name/@hn50/111325898767760054)
|
[Kart: DVC for geospatial and tabular data. Git for GIS](https://kartproject.org/), [Discussion](https://news.ycombinator.com/item?id=38073512#git), [Go to Post from 2023-10-30T20:40:06](https://social.lansky.name/@hn50/111325898767760054)
|
||||||
|
|
||||||
[Use KeePassXC to sign your git commits](https://code.mendhak.com/keepassxc-sign-git-commit-with-ssh/)
|
[Use KeePassXC to sign your Git commits](https://code.mendhak.com/keepassxc-sign-git-commit-with-ssh/)
|
||||||
|
|
||||||
## Git commands and examples
|
## Git Commands and Examples
|
||||||
|
|
||||||
Create a new branch locally within a already cloned repository:
|
Create a new branch locally within an already cloned repository:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git branch -b <branch-name>
|
git checkout -b <branch-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
Delete local branch
|
Delete a local branch:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git branch -d <branch-name>
|
git branch -d <branch-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
Rebase auf main branch:
|
Rebase onto the main branch:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git fetch
|
git fetch
|
||||||
|
|
@ -28,54 +28,54 @@ git rebase origin/main
|
||||||
git push origin HEAD -f
|
git push origin HEAD -f
|
||||||
```
|
```
|
||||||
|
|
||||||
Abort rebase:
|
Abort a rebase:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git rebase --abort
|
git rebase --abort
|
||||||
```
|
```
|
||||||
|
|
||||||
Stash changes
|
Stash changes:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git stash
|
git stash
|
||||||
git stash pop
|
git stash pop
|
||||||
```
|
```
|
||||||
|
|
||||||
Revwert a commit:
|
Revert a commit:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Sollte funktionieren, wenn nur 1 Commit geamcht wurde
|
# Should work if only 1 commit was made
|
||||||
git reset --soft HEAD~1
|
git reset --soft HEAD~1
|
||||||
|
|
||||||
# Eher Brechstange:
|
# More forceful approach:
|
||||||
git revert cb7cf15b54ff09495201244b070d18d96d4703ce
|
git revert cb7cf15b54ff09495201244b070d18d96d4703ce
|
||||||
git reset --hard HEAD~2
|
git reset --hard HEAD~2
|
||||||
```
|
```
|
||||||
|
|
||||||
Show changes beween two tags:
|
Show changes between two tags:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# tag from previouse version
|
# Tag from previous version
|
||||||
git tag -a v0.1.0 -m "Release version 0.1.0"
|
git tag -a v0.1.0 -m "Release version 0.1.0"
|
||||||
|
|
||||||
# add changes
|
# Add changes
|
||||||
git commit -am "add hint for change log"
|
git commit -am "add hint for change log"
|
||||||
# and more
|
# and more
|
||||||
|
|
||||||
# add final tag vor version
|
# Add final tag for version
|
||||||
git tag -a v0.2.0 -m "Release version 0.2.0"
|
git tag -a v0.2.0 -m "Release version 0.2.0"
|
||||||
|
|
||||||
# show diff between tags
|
# Show diff between tags
|
||||||
git log v0.1.0..v0.2.0 --no-merges --format="%h - %s" --date=short
|
git log v0.1.0..v0.2.0 --no-merges --format="%h - %s" --date=short
|
||||||
```
|
```
|
||||||
|
|
||||||
Git diff log between commits
|
Git diff log between commits:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git log 79e28d9cef4cc777afc9e5b2569a5d34d9331867..6888fd61ae9d5744effcf27620a645e1750cbafc --no-merges --format="%h - %s (%an, %ad)" --date=short
|
git log 79e28d9cef4cc777afc9e5b2569a5d34d9331867..6888fd61ae9d5744effcf27620a645e1750cbafc --no-merges --format="%h - %s (%an, %ad)" --date=short
|
||||||
```
|
```
|
||||||
|
|
||||||
Debug SSH connection via git
|
Debug SSH connection via Git:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
GIT_SSH_COMMAND="ssh -v"
|
GIT_SSH_COMMAND="ssh -v"
|
||||||
|
|
@ -83,16 +83,15 @@ git pull
|
||||||
unset GIT_SSH_COMMAND
|
unset GIT_SSH_COMMAND
|
||||||
```
|
```
|
||||||
|
|
||||||
Add executable flag on windows
|
Add executable flag on Windows:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git update-index --chmod=+x git_mirror.sh
|
git update-index --chmod=+x git_mirror.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
check the remote branch of a cloned repository and change it
|
Check the remote branch of a cloned repository and change it:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
||||||
git remote -v
|
git remote -v
|
||||||
|
|
||||||
git remote set-url origin xwr@vs-ssh.visualstudio.com:v3/xwr/jambor.pro/app-docker-compose
|
git remote set-url origin xwr@vs-ssh.visualstudio.com:v3/xwr/jambor.pro/app-docker-compose
|
||||||
|
|
@ -106,19 +105,18 @@ for branch in $(git branch -r | grep -v '\->'); do
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
Renaming branches
|
Renaming branches:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Delete remote branch
|
||||||
# delete remote branch
|
|
||||||
git push origin --delete wikiMaster
|
git push origin --delete wikiMaster
|
||||||
|
|
||||||
# delete local branch
|
# Delete local branch
|
||||||
git branch -d wikiMaster
|
git branch -d wikiMaster
|
||||||
|
|
||||||
# move branch
|
# Move branch
|
||||||
git branch -m main wikiMaster
|
git branch -m main wikiMaster
|
||||||
|
|
||||||
# push
|
# Push
|
||||||
git push origin HEAD
|
git push origin HEAD
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue