# Git ์‚ฌ์šฉ๋ฐฉ๋ฒ•

git config --global init.defaultBranch main
git --version
git config --global user.name "์‚ฌ์šฉ์ž๋ช…"
git config --global user.email "์ด๋ฉ”์ผ"
git config --global init.defaultBranch main

git config --list

cd C:\Temp\sample
git init
git add *
git commit -m "์„ค๋ช…"
git status

git remote add origin https://github.com/oseongryu/sample.git
git push origin main

# gitignore global

touch ~/.gitignore
git config --global core.excludesfile ~/.gitignore

# Git Revert

git log
git reset --hard "์›ํ•˜๋Š” HEAD"
git push -f origin main

# Git Reset

git reset HEAD^ // ๋งˆ์ง€๋ง‰ ์ปค๋ฐ‹ ์‚ญ์ œ
git reset --hard HEAD // ๋งˆ์ง€๋ง‰ ์ปค๋ฐ‹ ์ƒํƒœ๋กœ ๋˜๋Œ๋ฆผ
git reset HEAD * // ์Šคํ…Œ์ด์ง•์„ ์–ธ์Šคํ…Œ์ด์ง•์œผ๋กœ ๋ณ€๊ฒฝ

# git ๋ณ‘ํ•ฉ์ทจ์†Œ

git merge --abort

# git config ์„ค์ •์‹œ ์ €์žฅ ์œ„์น˜

System	 <git-install-root>\mingw64\etc\gitconfig	 gitconfig
Global	 C:\Users\username\.gitconfig	 .gitconfig
Local	 <git-repo>\.git\config	 config
Worktree	 <git-repo>\.git\config.worktree	 config.worktree
Portable	 C:\ProgramData\Git\config	 config

git config --global user.name "์‚ฌ์šฉ์ž๋ช…"
git config --global user.email "์ด๋ฉ”์ผ"
git config --local user.name "์‚ฌ์šฉ์ž๋ช…"
git config --local user.email "์ด๋ฉ”์ผ"
git config --list

# git branch

git checkout -b deploy/prod
git push origin deploy/prod
git branch --set-upstream-to origin/deploy/prod

### branch ์‚ญ์ œ
git checkout amin
git branch --delete deploy/prod
git branch -D deploy/prod
git push origin :deploy/prod

# git rebase

git branch
git checkout develop
git push

git checkout feature/test
git rebase develop
git checkout develop
git merge feature/test --ff

# git ๋กœ์ปฌ ๋‚ด์šฉ ์—…๋ฐ์ดํŠธ

git branch -r
git remote update

git branch -a

# git log

git log --oneline
git log --pretty=format:"%h - %an, %ar : %s"
git log --pretty=format:"%h %cd %an %s"
git log --stat

git log --pretty=format:"%h %cd %an %s" --since="2022-11-01" --until="2022-11-30" --committer=aaaa --committer=bbbb --committer=cccc
git log --pretty=format:"%h %cd %an %s" --since="2022-12-01" --until="2022-12-31" --committer=aaaa --committer=bbbb --committer=cccc
git log --pretty=format:"%h %cd %an %s" --since="2023-01-01" --until="2023-01-31" --committer=aaaa --committer=bbbb --committer=cccc

# ํŒŒ์ผ๋ชฉ๋ก ์ถ”๊ฐ€ํ™•์ธ
git log --name-only --pretty=format:"%h %cd %an %s" --since="2022-11-01" --committer=aaaa

# ํŒŒ์ผ๋ชฉ๋ก ์ •๋ ฌ ๋ฐ ํ•˜๋‚˜๋กœ ํ†ตํ•ฉ
git log --name-only --pretty=format: --since="2022-02-01" --committer=aaa | sort | uniq

# ๋ฆฌ๋ˆ…์Šค ๊ถŒํ•œ ๋ฌธ์ œ ๊ด€๋ จ์ด ์žˆ์„ ๊ฒฝ์šฐ (.git์˜ ํด๋”์—์„œ ํ™•์ธ)

Unable to create '/home/user/repo/.git/refs
chown -R user:usergroup file/folder

# ๋งฅ์—์„œ git ๊ณ„์ • 2๊ฐœ ์ด์ƒ ์‚ฌ์šฉ ์‹œ ssh ์ธ์ฆ

### ssh-keygen ์ƒ์„ฑ
cd ~/.ssh or mkdir ~/.ssh

ssh-keygen -t <์•”ํ˜ธํ™”๋ฐฉ์‹> -b <keyํฌ๊ธฐ ๊ธฐ๋ณธ3072> -C '๊นƒํ—™๋“ฑ๋ก๋ฉ”์ผ@๋ฉ”์ผ.com'
ssh-keygen -t rsa -b 4096 -C 'myuser@email.com'
ssh-keygen -t rsa -b 4096 -C 'oseongryu@gmail.com'

Enter file in which to save the key (/Users/${USER}/.ssh/id_rsa): <id_rsa_์ด๋ฆ„์ง€์ •>
Enter file in which to save the key (/Users/${USER}/.ssh/id_rsa): id_rsa_myuser
Enter file in which to save the key (/Users/${USER}/.ssh/id_rsa): id_rsa_oseongryu


eval "$(ssh-agent -s)"
ssh-add <keyํŒŒ์ผ๊ฒฝ๋กœ>
ssh-add ~/.ssh/id_rsa_myuser
ssh-add ~/.ssh/id_rsa_oseongryu

ssh-add -l

* ์‚ญ์ œ ํ›„ ๋‹ค์‹œ ๋งŒ๋“ค ํ•„์š”๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ
ssh-add -D

touch ~/.ssh/config
vi ~/.ssh/config

--- ํ•ด๋‹น ๋‚ด์šฉ ์ถ”๊ฐ€
# Git myuser
Host github.com-myuser
    HostName github.com
    IdentityFile ~/.ssh/id_rsa_myuser
    User myuser
# Git oseongryu
Host github.com-oseongryu
    HostName github.com
    IdentityFile ~/.ssh/id_rsa_oseongryu
    User oseongryu

### github > settings > SSH and GPG keys >> New SSH Key
pbcopy < ~/.ssh/id_rsa_f5074.pub

### ํ…Œ์ŠคํŠธ
ssh -T git@github.com-myuser

### ์‚ฌ์šฉ
git remote add origin git@github.com-oseongryu:oseongryu/til.git
git remote set-url origin git@github.com-oseongryu:oseongryu/til.git

# ๋‹ค๋ฅธ ๋งฅ์œผ๋กœ .ssh์„ค์ • ์˜ฎ๊ธฐ๊ธฐ


๋‹ค๋ฅธ ๋งฅ์—์„œ .ssh ํŒŒ์ผ๋งŒ ์˜ฎ๊ฒจ์˜ฌ ๊ฒฝ์šฐ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋‚˜ํƒ€๋‚  ์ˆ˜ ์žˆ์Œ
private key์˜ permissions์ด ๋งŽ์ด ๋˜์–ด ์žˆ์–ด์„œ ์ƒ๊ธฐ๋Š” ๋ฌธ์ œ์˜€์Œ
์˜ฎ๊ฒจ์˜จ ํŒŒ์ผ์˜ ๊ถŒํ•œ์„ ๋ณ€๊ฒฝํ•ด์„œ ์ฒ˜๋ฆฌ

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts


---
Warning: Permanently added 'github.com,64:ff9b::344e:e76c' (RSA) to the list of known hosts.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/oseongryu/.ssh/id_rsa_oseongryu' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/Users/oseongryu/.ssh/id_rsa_oseongryu": bad permissions
---

# ์›๊ฒฉ์—์„œ ssh์„ค์ •์‹œ

chown $USER ~/.ssh/config
chmod 644 ~/.ssh/config

# git Commit Message Structure

feat : ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€
fix : ๋ฒ„๊ทธ ์ˆ˜์ •
docs : ๋ฌธ์„œ ์ˆ˜์ •
style : ์ฝ”๋“œ ํฌ๋งทํŒ…, ์„ธ๋ฏธ์ฝœ๋ก  ๋ˆ„๋ฝ, ์ฝ”๋“œ ๋ณ€๊ฒฝ์ด ์—†๋Š” ๊ฒฝ์šฐ
refactor : ์ฝ”๋“œ ๋ฆฌํŽ™ํ† ๋ง
test : ํ…Œ์ŠคํŠธ ์ฝ”๋“œ, ๋ฆฌํŽ™ํ† ๋ง ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€
chore : ๋นŒ๋“œ ์—…๋ฌด ์ˆ˜์ •, ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ € ์ˆ˜์ •

feat: (new feature for the user, not a new feature for build script)
fix: (bug fix for the user, not a fix to a build script)
docs: (changes to the documentation)
style: (formatting, missing semi colons, etc; no production code change)
refactor: (refactoring production code, eg. renaming a variable)
test: (adding missing tests, refactoring tests; no production code change)
chore: (updating grunt tasks etc; no production code change)

# git local pull request

#### local get pull request
git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"
git fetch origin
git checkout -t origin/pr/35

s#### config ์ถ”๊ฐ€
git config --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"

#### config ์‚ญ์ œ
git config --unset --local remote.origin.fetch
git config --unset-all --local remote.origin.fetch
git config --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"

# fetch github pr to local

git pull origin pull/35/head



-- git config์— ์„ค์ •
[alias]
  pr  = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
  pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"

 git pr 35
 git pr-clean

# SSL certificate problem: self signed certificate in certificate chain

git config --global http.sslVerify false

# git remote origin

# 1
git config --local --list
git remote add origin git@github.com:oseongryu/til.git

git remote remove origin
git config --local --list

git remote add origin git@github.com:oseongryu/til.git
git push -u origin main

# 2
git remote set-url origin git@github.com:oseongryu/til.git

# git merge option

git merge [branch] --strategy-option ours
git merge [branch] --strategy-option theirs

#### fast-forward ๊ด€๊ณ„์— ์žˆ์œผ๋ฉด commit์„ ์ƒ์„ฑํ•˜์ง€ ์•Š๊ณ  ํ˜„์žฌ ๋ธŒ๋žœ์น˜์˜ ์ฐธ์กฐ ๊ฐ’ ๋งŒ ๋ณ€๊ฒฝ(default)
git merge --ff [branch]

#### fast-forward ๊ด€๊ณ„์— ์žˆ์–ด๋„ merged commit ์ƒ์„ฑ
git merge --no-ff [branch]

#### fast-forward ๊ด€๊ณ„์— ์žˆ์–ด๋„ merged commit ์ƒ์„ฑ, merging ๋ธŒ๋žœ์น˜ ์ •๋ณด ์ƒ๋žต
git merge --squash [branch]

# git remove specific file on all commit

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ํŒŒ์ผ๋ช…' --prune-empty --tag-name-filter cat -- --all
git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch 99_00_Software/[IntelliJ].md' --prune-empty --tag-name-filter cat -- --all

# git stage to unstage

git reset HEAD -- .

# git discard change

git restore .
git reset --hard

# git Directory ๊ณ„์ •์„ค์ •

git config --list --show-origin

.gitconfig(์ œ์™ธ)
---
[user]
    email = oseongryu@gmail.com
    name = oseongryu
---

.gitconfig(์ถ”๊ฐ€)
---
[includeIf "gitdir:~/git/personal/"]
    path = .gitconfig-personal
[includeIf "gitdir:~/git/professional/"]
    path = .gitconfig-professional
---

.gitconfig-personal(์ถ”๊ฐ€)
---
[user]
    email = oseongryu@gmail.com
    name = oseongryu
---

.gitconfig-professional(์ถ”๊ฐ€)
---
[user]
    email = osryu@gmail.com
    name = osryu
---

# ๋ฆฌ๋ชจํŠธ ๋ธŒ๋žœ์น˜ ์ฐธ์กฐ ์—…๋ฐ์ดํŠธ

# ๋ฆฌ๋ชจํŠธ ๋ธŒ๋žœ์น˜์˜ ๋” ์ด์ƒ ์œ ํšจํ•˜์ง€ ์•Š์€ ์ฐธ์กฐ๋ฅผ ๊นจ๋—์ด ์ง€์šฐ๋Š” ๋ช…๋ น์–ด
git remote prune origin
git remote update --prune

# ๋กœ์ปฌ ์ €์žฅ์†Œ๋ฅผ ์ตœ์‹  ์ •๋ณด๋กœ ๊ฐฑ์‹ (๋ฆฌ๋ชจํŠธ ์ €์žฅ์†Œ์™€ ๋™๊ธฐํ™”)ํ•˜๋ฉฐ ์ž๋™์ ์œผ๋กœ ๋”์ด์ƒ ์œ ํšจํ•˜์ง€ ์•Š์€ ์ฐธ์กฐ๋ฅผ ์ œ๊ฑฐ
git fetch -p

# ์‹ค์ˆ˜๋กœ ์‚ญ์ œํ•œ ๋ธŒ๋žœ์น˜ ๋ณต๊ตฌํ•˜๊ธฐ

git reflog
git checkout -b 'temp' HEAD@{1}

# ์›๊ฒฉ ๋ธŒ๋žœ์น˜ ์‚ญ์ œ

git push origin --delete feature/oseongryu

# git ์ปค๋ฐ‹์ด ์ž˜๋ชป๋˜์–ด ๋ณต๊ตฌํ•˜๋Š” ๋ฐฉ๋ฒ•

// 1. ๋ฐฉ๋ฒ•
1. ๋กœ๊ทธ๋กœ ํŠน์ • ๋ถ€๋ถ„ ํ—ค๋” ํ™•์ธ
git log --pretty=format:"%h %cd %an %s" --since="2022-11-01" --until="2022-11-30" --committer=aaaa --committer=bbbb --committer=cccc
git log --pretty=format:"%h %cd %an %s" --since="2022-12-01" --until="2022-12-31" --committer=aaaa --committer=bbbb --committer=cccc
git log --pretty=format:"%h %cd %an %s" --since="2023-01-01" --until="2023-01-31" --committer=aaaa --committer=bbbb --committer=cccc
2. cherry-pick๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํ†ตํ•ฉ

// 2. ๊ฐ„ํŽธ ๋ฐฉ๋ฒ•
์ตœ์ดˆ ๋Œ๋ฆด ๋ถ€๋ถ„์œผ๋กœ git reset --soft [HEAD๋ช…] ์œผ๋กœ ๋Œ๋ฆฐํ›„
git status๋กœ ์ˆ˜์ •ํ•œ ํŒŒ์ผ์—์„œ ์ž์‹ ์ด ์ˆ˜์ •ํ•œ ํŒŒ์ผ๋ชฉ๋ก ํ™•์ธ

# ssh config (github, gitblit, gitlab)

# 2022.09.23. github oseongryu
Host github.com
    HostName github.com
    Port 22
    IdentityFile ~/.ssh/id_rsa_oseongryu
    User oseongryu

# 2022.09.23. gitlab osryu
Host corporation.gitlab.com
    HostName corporation.gitlab.com
    # Port 22
    IdentityFile ~/.ssh/id_rsa
    User osryu

# 2022.09.23. gitblit osryu
Host corporation.gitblit.com
    HostName corp.gitblit.com
    Port 29418
    IdentityFile ~/.ssh/id_rsa
    User osryu
    PubkeyAcceptedAlgorithms +ssh-rsa
    HostKeyAlgorithms +ssh-rsa

# git stash

git stash
git stash save

git stash list

git stash apply
git stash apply stash@{0}

git stash drop stash@{0}

git stash pop

# gitlab

๋ฐ์ดํ„ฐ์ด๊ด€
https://trytoso.tistory.com/1313

์ผ๋ถ€ ํŒŒ์ผ๋งŒ Merge
git checkout -p [๊ฐ€์ ธ์˜ฌ ํŒŒ์ผ์ด ์žˆ๋Š” branch๋ช…] [๊ฐ€์ ธ์˜ฌ ํŒŒ์ผ์˜ ๊ฒฝ๋กœ]
# ํ˜„์žฌ ์ž‘์—…์ค‘์ธ(checkout) ๋ธŒ๋žœ์น˜๋Š” feature/devMain์œผ๋กœ ๊ฐ€์ •
$ git checkout -p feature/pubMain \client\components\pages\common\NavTab.vue

y - stage this hunk โ†’ ํŽ˜์ด์ง€ ๋‹จ์œ„ ์Šน์ธ
n - do not stage this hunk
q - quit; do not stage this hunk nor any of the remaining ones
a - stage this hunk and all later hunks in the file โ†’ ์ผ๊ด„ ์Šน์ธ
d - do not stage this hunk nor any of the later hunks in the file
g - select a hunk to go to
/ - search for a hunk matching the given regex
j - leave this hunk undecided, see next undecided hunk
J - leave this hunk undecided, see next hunk
k - leave this hunk undecided, see previous undecided hunk
K - leave this hunk undecided, see previous hunk
s - split the current hunk into smaller hunks
e - manually edit the current hunk
? - print help

Origin/main์˜ ์†Œ์Šค๋กœ ๊ฐ•์ œ ์ ์šฉ
# ์•„๋ฌด๊ฒƒ๋„ ๋ณ‘ํ•ฉํ•˜๊ฑฐ๋‚˜ ๋ฆฌ๋ฒ ์ด์Šค ํ•˜์ง€ ์•Š๊ณ  ์›๊ฒฉ์ง€์—์„œ ์ตœ์‹  ์ปค๋ฐ‹ ์ •๋ณด๋ฅผ ๋‹ค์šด๋กœ๋“œ
$ git fetch --all
# ํ˜„์žฌ ์ž‘์—…์ค‘์ธ ๊ฒƒ์„ ๋ฐฑ์—… ๋ธŒ๋žœ์น˜๋กœ ๋ถ„๊ธฐ(ํ•„์š”์‹œ)
$ git branch backup-main
# ๊ฐ•์ œ๋กœ ๋‚ด๋ ค๋ฐ›๊ณ ์ž ํ•˜๋Š” ๋ธŒ๋žœ์น˜๋กœ ๋ฆฌ์…‹
# --hard ์˜ต์…˜์€ ๋กœ์ปฌ์— ์ถฉ๋Œ ๊ฐ€๋Šฅํ•œ ์ˆ˜์ •์‚ฌํ•ญ์ด ์žˆ์–ด๋„ ๋ฌด์‹œํ•˜๊ณ  ๋‚ด๋ ค๋ฐ›์Œ
$ git reset --hard origin/main
$ git reset --hard origin/<branch_name>

# git submodules

git submodule add git@github.com:oseongryu/corp-script.git
git submodule add git@github.com:oseongryu/corp-script.git 00_corp_script

### remove
To remove a submodule you need to:

1. Delete the relevant section from the .gitmodules file.
2. Stage the .gitmodules changes:
git add .gitmodules
3. Delete the relevant section from .git/config.
4. Remove the submodule files from the working tree and index:
git rm --cached path_to_submodule (no trailing slash).
5. Remove the submodule's .git directory:
rm -rf .git/modules/path_to_submodule
6. Commit the changes:
git commit -m "Removed submodule <name>"
7. Delete the now untracked submodule files:
rm -rf path_to_submodule

git submodule init
git submodule update
git submodule foreach git checkout main

# git bash zip

C:\Program Files\Git\mingw64\bin https://stackoverflow.com/questions/38782928/how-to-add-man-and-zip-to-git-bash-installation-on-windows

  1. Navigate to this sourceforge page (opens new window)
  2. Download zip-3.0-bin.zip
  3. In the zipped file, in the bin folder, find the file zip.exe.
  4. Extract the file zip.exe to your mingw64 bin folder (for me: C:\Program Files\Git\mingw64\bin)
  5. Navigate to to this sourceforge page (opens new window)
  6. Download bzip2-1.0.5-bin.zip
  7. In the zipped file, in the bin folder, find the file bzip2.dll
  8. Extract bzip2.dll to your mingw64\bin folder (same folder as above: C:\Program Files\Git\mingw64\bin)

# git status filename oneline

git status --porcelain | sed s/^...//
git status -s | cut -c4-

git diff --name-only
git diff --name-only --staged
git diff --name-only HEAD

# git add ์ทจ์†Œํ•˜๊ธฐ(unstage๋กœ ๋ณ€๊ฒฝ)

git add .

# ์ „์ฒด ๋˜๋Œ๋ฆฌ๊ธฐ
git reset HEAD
# ํŠน์ •ํŒŒ์ผ ๋˜๋Œ๋ฆฌ๊ธฐ
git restore --staged filename

# git ํŠน์ • ์ปค๋ฐ‹ ์ด๋ฏธ์ง€ ํŒŒ์ผ์ด ์‚ฌ๋ผ์ง€์ง€ ์•Š๋Š” ๊ฒฝ์šฐ

ํŠน์ • ์ปค๋ฐ‹ ์ด๋ฏธ์ง€ ํŒŒ์ผ์ด ๊นƒ์œผ๋กœ ์‚ญ์ œ๊ฐ€ ๊ณ„์† ๋‚จ๋Š” ๊ฒฝ์šฐ
.git > config ํŒŒ์ผ์— ํ•ด๋‹น ๋‚ด์šฉ์ด ์‚ฌ๋ผ์ง
[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	ignorecase = true

# git ํŠน์ • ํŒŒ์ผ์˜ ์ˆ˜์ •์‚ฌํ•ญ ๋ฌด์‹œ

# ํŠน์ • ํŒŒ์ผ์˜ ์ˆ˜์ •์‚ฌํ•ญ ๋ฌด์‹œํ•˜๊ธฐ
git update-index --assume-unchanged [file path]
# ํŠน์ • ํŒŒ์ผ์˜ ์ˆ˜์ •์‚ฌํ•ญ ๋ฌด์‹œ ์ทจ์†Œํ•˜๊ธฐ
git update-index --no-assume-unchanged [file path]
# ์ˆ˜์ •์‚ฌํ•ญ ๋ฌด์‹œ ํŒŒ์ผ ์กฐํšŒ
git ls-files -v|grep '^h'

# git lcoal์—์„œ๋งŒ ์ ์šฉ

# 1
vim .git/info/exclude

git update-index --skip-worktree .vscode/launch.json
git update-index --no-skip-worktree .vscode/launch.json

# 2
git update-index --assume-unchanged .vscode/launch.json
git update-index --no-assume-unchanged .vscode/launch.json
git ls-files -v | grep '^[[:lower:]]'

# git push ํ•˜์ง€ ์•Š์€ ๋ชฉ๋ก ํ™•์ธ

git log --branches --not --remotes
git log --branches --not --remotes --oneline --graph --decorate

# git log clear

git reflog expire --expire=now --all
git gc --aggressive --prune=all

# git alias

# https://hannut91.github.io/blogs/git/config
git config --global alias.cm commit
git config --global alias.co checkout

# ๋จธ์ง€๋œ ๋ธŒ๋žœ์น˜ ์ผ๊ด„์‚ญ์ œ (.gitconfig)
[alias]
    cleanbranch = "!git branch -d $(git branch --merged | grep -v '\\<master\\>')"

# git .gitattributes

# https://git-scm.com/book/ko/v2/Git๋งž์ถค-Git-Attributes
* text eol=lf
*.png binary
*.gif binary
*.woff binary
*.woff2 binary
*.otf binary
*.zip binary


* linguist-vendored
*.py linguist-vendored=false

# *.js linguist-detectable=false
# *.html linguist-detectable=false
# *.css linguist-detectable=false
# *.scss linguist-detectable=false

# git proxy (ssh, http)

# 1.ssh (git clone git@github.com:kubernetes/kubernetes.git)
# add ProxyCommand in ~/.ssh/config
 Host github.com
    HostName github.com
    Port 22
    IdentityFile ~/.ssh/id_rsa
    User oseongryu
    ProxyCommand nc -x 192.0.0.4:8000 -X connect %h %p #mac
    # ProxyCommand connect -S 192.0.0.4:8000 %h %p # ServerAliveInterval 10 #Windows

# only cli
git -c "http.proxy=192.0.0.4:8000" clone git@github.com:oseongryu/docker-composes.git



# 2.http (git clone https://github.com/kubernetes/kubernetes.git)
# add config in "~/.gitconfig"
git config --global http.proxy http://192.0.0.4:8000
git config --global https.proxy https://192.0.0.4:8000

git config --global http.proxy 'socks5://192.0.0.4:8000'
git config --global https.proxy 'socks5://192.0.0.4:8000'

# References

Git Portable Location
https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/Where-system-global-and-local-Windows-Git-config-files-are-saved
https://trustyoo86.github.io/git/2017/11/28/git-remote-branch-create.html

https://velog.io/@hwang-eunji/github-2%EA%B0%9C-%EA%B3%84%EC%A0%95-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0


https://trustyoo86.github.io/git/2017/11/28/git-remote-branch-create.html
https://beomseok95.tistory.com/167#google_vignette
git rebase: https://junlab.tistory.com/m/203
https://doublesprogramming.tistory.com/256
git local pull request: https://blog.outsider.ne.kr/1204
git cherry-pick: https://gitbetter.substack.com/p/how-to-use-git-cherry-pick-effectively
git submodule: https://pinedance.github.io/blog/2019/05/28/Git-Submodule
Last Updated: 4/13/2025, 11:14:44 PM