git config

git config

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2020 Jan 10 8:23
Editor
Edited
Edited
2025 May 7 17:57
git config --global credential.helper store git config --global user.name "seonglae" git config --global user.email "sungle3737@gmail.com" git config --global init.defaultBranch main git config --global --replace-all core.pager "less -F -X"
WARNING: If you use credential.helper store from the answer, your password is going to be stored completely unencrypted ("as is") at ~/.git-credentials. Please consult the comments section below or the answers from the "Linked" section, especially if your employer has zero tolerance for security issues.
~/.gitconfig
 
 
git config --global --unset user.name git config --global --unset user.email git config --global --unset credential.helper
 
 

Windows File error

[core] autocrlf = false safecrlf = false eol = lf filemode = false

git config alias

If windows change open to start

[alias] # ******************** # My dumbass typos ammend = commit --amend amend = commit --amend # ********************* # Github # From - https://salferrarello.com/git-alias-open-pull-request-github/ pr = "!f() { \ open \"$(git ls-remote --get-url $(git config --get branch.$(git rev-parse --abbrev-ref HEAD).remote) \ | sed 's|git@github.com:\\(.*\\)$|https://github.com/\\1|' \ | sed 's|\\.git$||'; \ )/compare/$(\ git config --get branch.$(git rev-parse --abbrev-ref HEAD).merge | cut -d '/' -f 3- \ )?expand=1\"; \ }; f" hub = "!f() { \ open \"$(git ls-remote --get-url \ | sed 's|git@github.com:\\(.*\\)$|https://github.com/\\1|' \ | sed 's|\\.git$||'; \ )\"; \ }; f"
  • git pr -> Open this PR at github.com
  • git hub -> Open this repo at github.com
  • git amend -> Alias for git commit --amend
  • git ammend -> How I always misspell ‘amend’, also alias for git commit --amend
 
 
 
Can't seem to discard changes in Git
What changes does git diff show on the file? On windows, I've seen issues with line-endings causing issues like this. In that case, look at what settings you have for git config core.autocrlf and git config core.safecrlf. There is some documentation for these settings here.
Can't seem to discard changes in Git
Git asks for username every time I push
Asked Whenever I try to push into my repo git asks for both username & password. I have no problem in re-entering my password each time but the problem is in entering username. I use https to clone my repository. So, how can I configure git so that it doesn't asks for username on each git push.
Git asks for username every time I push
alias
Git Bash bash: open: command not found
I'm new to Git Bash, just freshly downloaded this for use in my class today, on the first class module it ask me to cd in to different directory and ls the content which works perfectly fine in Git Bash, then it ask me to open a README.md file in
Git Bash bash: open: command not found
Idiot proof git
I'm an idiot. And git is hard. A lot of places use a rebase-based Git workflow, and I've made git less hard with a set of handy aliases. Put these in your ~/.gitconfig and turn git into an actually less painful command line tool to use. Here's documentation for these idiot-proof git aliases.
Idiot proof git
 

Recommendations