-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from ShihTingJustin/main
update tags
- Loading branch information
Showing
18 changed files
with
236 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"editor.wordWrap": "on", | ||
"cSpell.words": ["tsmc"] | ||
"cSpell.words": ["Bootcamp", "tsmc"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
--- | ||
title: 'Git Snippet' | ||
summary: 'Git config and commands that I use frequently' | ||
title: "Git Snippet" | ||
summary: "Git config and commands that I use frequently" | ||
categories: ["note"] | ||
tags: ["Git"] | ||
tags: ["Git", "Snippet", "Command"] | ||
#externalUrl: "" | ||
# showSummary: true | ||
date: 2023-04-06 | ||
draft: false | ||
--- | ||
|
||
## Config | ||
|
||
### Get repository or global options | ||
|
||
```sh copy | ||
git config --list | ||
``` | ||
|
@@ -20,56 +22,71 @@ git config -l | |
``` | ||
|
||
### Identity setup | ||
|
||
```sh copy | ||
git config --global user.name "John Doe" | ||
git config --global user.email [email protected] | ||
``` | ||
|
||
you can also use `--local` to use this identity only in the directory | ||
|
||
```sh copy | ||
git config --local user.name "John Doe" | ||
git config --local user.email [email protected] | ||
``` | ||
|
||
## Remote | ||
|
||
### | ||
|
||
```sh copy | ||
git remote set-url origin <repo url> | ||
``` | ||
|
||
## Tag | ||
|
||
Push branch and tag | ||
|
||
```sh copy | ||
git push --follow-tags | ||
``` | ||
|
||
Delete origin tag | ||
|
||
```sh copy | ||
git push --delete origin v0.1.3 | ||
``` | ||
|
||
Delete local tag | ||
|
||
```sh copy | ||
git tag -d v0.1.3 | ||
``` | ||
|
||
## Commit | ||
|
||
### Remove latest commit | ||
|
||
```sh copy | ||
git reset HEAD^ --hard | ||
``` | ||
|
||
## Branch | ||
|
||
### Reomve local branch | ||
|
||
```sh copy | ||
git branch -D <branch> | ||
``` | ||
|
||
### Reomve remote branch | ||
|
||
```sh copy | ||
git push --delete <remote> <branch> | ||
``` | ||
|
||
## Git Aliases | ||
|
||
```sh copy | ||
git config --global alias.br branch | ||
git config --global alias.co checkout | ||
|
@@ -80,8 +97,8 @@ git config --global alias.pl pull | |
git config --global alias.ps push | ||
``` | ||
|
||
|
||
## Reset author information for all commits | ||
|
||
for all branch | ||
|
||
```sh copy | ||
|
@@ -94,6 +111,7 @@ git filter-branch -f --env-filter ' | |
``` | ||
|
||
you could also use `HEAD` | ||
|
||
```sh copy | ||
git filter-branch -f --env-filter ' | ||
GIT_AUTHOR_NAME='ShihTingJustin' | ||
|
@@ -102,6 +120,7 @@ git filter-branch -f --env-filter ' | |
GIT_COMMITTER_EMAIL='[email protected]' | ||
' HEAD | ||
``` | ||
|
||
src: https://git-scm.com/docs/git-filter-branch | ||
|
||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.