Last active
April 20, 2020 17:30
-
-
Save washanhanzi/3abf842a8fe80f2bde1c11a04b1e7722 to your computer and use it in GitHub Desktop.
Revisions
-
washanhanzi revised this gist
Apr 20, 2020 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -77,6 +77,10 @@ git reset origin/dev git add --all git commit -m 'my commit message' ``` # clear cache ``` git rm -rf --cached . ``` # show lines of all file ``` -
washanhanzi revised this gist
Apr 13, 2020 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -78,6 +78,11 @@ git add --all git commit -m 'my commit message' ``` # show lines of all file ``` git ls-files | xargs wc -l ``` # set proxy ``` git config --global http.proxy http://localhost:7890 -
washanhanzi revised this gist
Apr 7, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ git config --global credential.github.com.useHttpPath true > https://github.com/microsoft/Git-Credential-Manager-for-Windows/issues/749 - locally store credentials @.git/config ``` [credential] helper = store @@ -48,7 +48,7 @@ git config --global user.email "[email protected]" ``` - locally user info @.git/config ``` [user] name = frank -
washanhanzi revised this gist
Feb 26, 2020 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -76,4 +76,9 @@ git push -f origin master git reset origin/dev git add --all git commit -m 'my commit message' ``` # set proxy ``` git config --global http.proxy http://localhost:7890 ``` -
washanhanzi created this gist
Jan 7, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,79 @@ # Credentials - clear credential cache ```shell git config --global --unset credential.helper git config --system --unset credential.helper ``` - set credential manager (windows) ```shell git config --global credential.helper manager ``` - multiple account (windows) ``` git config --global credential.github.com.useHttpPath true ``` > https://github.com/microsoft/Git-Credential-Manager-for-Windows/issues/749 - locally store credentials @.gitconfig ``` [credential] helper = store ``` - locally store credentials ```shell git config --global credential.helper store ``` - cache credentials expire 15min ```shell git config --global credential.helper cache ``` - cache credentials for custom expire time ```shell git config --global credential.helper 'cache --timeout=3600' ``` # User Info - global set user info ```shell git config --global user.name "frank" git config --global user.email "[email protected]" ``` - locally user info @.gitconfig ``` [user] name = frank email = [email protected] ``` # Ignore File @.gitignore # Clear Commits History ``` git checkout --orphan temp_branch git add -A git commit -am "init" git branch -D master git branch -m master git push -f origin master ``` # reset branch and squash commits ``` git reset origin/dev git add --all git commit -m 'my commit message' ```