Git
Git, and Solutions.
Permission denied (publickey)
: git push git clone
:SSH GitHub/GitLab
Solutions:
- SSH : ls ~/.ssh/id_*.pub
- : ssh-keygen -t ed25519 -C "your@email.com"
- GitHub: cat ~/.ssh/id_ed25519.pub → GitHub Settings → SSH Keys
- : ssh -T git@github.com
: SSH agent : eval $(ssh-agent) && ssh-add
CONFLICT (content): Merge conflict in <file>
: git merge git pull
:
Solutions:
- , <<<<<<< / ======= / >>>>>>>
- ,
- git add <file>
- git commit
: New,
You are in 'detached HEAD' state
: git checkout <commit-hash>
:HEAD commit
Solutions:
- : git checkout main
- : git checkout -b new-branch New
- : git branch new-branch git checkout new-branch
: git checkout <branch> commit hash,
! [rejected] main -> main (non-fast-forward)
: git push
:()
Solutions:
- : git pull --rebase origin main && git push
- : git fetch origin && git rebase origin/main && git push
- (): git push --force-with-lease
: git pull --rebase,
remote: error: File xxx is 123.45 MB; this exceeds GitHub's file size limit
: git push
:GitHub 100MB
Solutions:
- : git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch <file>' HEAD
- BFG Repo-Cleaner(): bfg --strip-blobs-bigger-than 100M
- Git LFS : git lfs track '*.psd'
- .gitignore
:.gitignore, Git LFS