์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- Absolute
- AGI
- ai
- AI agents
- AI engineer
- AI researcher
- ajax
- algorithm
- Algorithms
- aliases
- Array ๊ฐ์ฒด
- ASI
- bayes' theorem
- Bit
- Blur
- BOM
- bootstrap
- canva
- challenges
- ChatGPT
- Today
- In Total
A Joyful AI Research Journey๐ณ๐
Git, Mac) ์ปค๋ฐํ ํ ํน์ Author, Committer์ ์ด๋ฆ ์์ ํ๊ธฐ ๋ณธ๋ฌธ
Git, Mac) ์ปค๋ฐํ ํ ํน์ Author, Committer์ ์ด๋ฆ ์์ ํ๊ธฐ
yjyuwisely 2023. 6. 10. 20:27์ฒ์์ ํฐ๋ฏธ๋์์ ๊นํ๋ธ ์์ด๋, ๋น๋ฐ๋ฒํธ ์ค์ ํ ๋
๊นํ๋ธ์์ ๋ฐ๊ธ๋ฐ์ ํด๋์ ํ ํฐ(Tokens(Classic))์ ๋น๋ฐ๋ฒํธ๋ก ์ฌ์ฉํ๋ค.
1) ํด๋ ๊ฒฝ๋ก๋ฅผ ์ง์ ํด ์ฃผ๊ณ
์์) cd /Users/yeongjinyu/Documents/github
2) git clone์ ํ๋ค.
์์) git clone https://github.com/yjyuwisely/Traveling-from-Ulju-gun.git
git clone ๊น์ฃผ์
3) ํด๋ ๊ฒฝ๋ก๋ก ๋ค์ด๊ฐ๋ค.
์์) cd /Users/yeongjinyu/Documents/github/Traveling-from-Ulju-gun
ํฐ๋ฏธ๋์์ ๊นํ๋ธ ์ปค๋ฐ History์ ์๋ ์๋ชป ์
๋ ฅ๋
4) ํน์ Author์ ์ด๋ฆ์ ์์ ์ด ์ํ๋ ๊นํ๋ธ id๋ก ์์ ํ๋ ๋ฐฉ๋ฒ์ ๋ค์๊ณผ ๊ฐ๋ค.
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_NAME" = "์๋ชป ์
๋ ฅ๋ Author's ID" ]
then
GIT_COMMITTER_NAME="$์ํ๋ ID"
GIT_COMMITTER_EMAIL="$์ํ๋ EMAIL"
git commit-tree "$@"
else
git commit-tree "$@"
fi' -- --branches --tags
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_NAME" = "ยย export GIT_AUTHOR_EMAIL=@gmail.com”" ]
then
GIT_COMMITTER_NAME="$yjyuwisely"
GIT_COMMITTER_EMAIL="$yjyuwisely@gmail.com"
git commit-tree "$@"
else
git commit-tree "$@"
fi' -- --branches --tags
4.1) ๋ค๋ฅธ ๋ฐฉ๋ฒ์ผ๋ก, ๊นํ๋ธ Commit ํ์คํ ๋ฆฌ์ ์๋ Copy the full SHA๋ฅผ ์ด์ฉํด์
์ฝ๋์ ์์ ์ด ์ํ๋ Committer, Author์ ID, EMAIL์ ๊ฐ๊ฐ ์ถ๊ฐํ๋ฉด ๋๋ค.
๊ฒฐ๊ณผ๋ก, ๊นํ๋ธ History์์ ํน์ ID๊ฐ ์ปค๋ฐํ๋ค๊ณ ๋์จ๋ค.
git filter-branch --commit-filter '
if [ $GIT_COMMIT = ์ปค๋ฐ ID ]
then
export GIT_AUTHOR_NAME="$์ํ๋ ID"
export GIT_AUTHOR_EMAIL="$์ํ๋ EMAIL"
export GIT_COMMITTERS_NAME="$์ํ๋ ID"
export GIT_COMMITTERS_EMAIL="$์ํ๋ EMAIL"
fi
git commit-tree "$@"
' -- --branches --tags
git filter-branch -f --commit-filter '
if [ $GIT_COMMIT = 0e9a567c2c04c2d0c09df51b88950034b54c1666 ] ||
[ $GIT_COMMIT = 03a9f0e18c491d838b820d6b7daadfee6b238506 ] ||
[ $GIT_COMMIT = e0bc86ef3fa54d363a3ac5b39ad7a3932c5aa327 ] ||
[ $GIT_COMMIT = 8cc73d934734d138498a2e17fc646323e230c51d ] ||
[ $GIT_COMMIT = f3d60c7e98781bbdea6eee7580882432da24c55f ] ||
[ $GIT_COMMIT = f2f685918250bfe4c2e1f5518f5559518457da05 ]
then
export GIT_AUTHOR_NAME="$yjyuwisely"
export GIT_AUTHOR_EMAIL="$yjyuwisely@gmail.com"
export GIT_COMMITTERS_NAME="$yjyuwisely"
export GIT_COMMITTERS_EMAIL="$yjyuwisely@gmail.com"
fi
git commit-tree "$@"
' -- --branches --tags
git filter-branch -f --commit-filter '
if [ $GIT_COMMIT = ace20bb04315f0941473f012c2e286448f5b7300 ]
then
export GIT_AUTHOR_NAME="$yjyuwisely"
export GIT_AUTHOR_EMAIL="$yjyuwisely@gmail.com"
export GIT_COMMITTERS_NAME="$yjyuwisely"
export GIT_COMMITTERS_EMAIL="$yjyuwisely@gmail.com"
fi
git commit-tree "$@"
' -- --branches --tags
4.2) ํ๋จ์ ๊นํ๋ธ Commit ํ์คํ ๋ฆฌ์ ์๋ Copy the full SHA๋ฅผ ์ด์ฉํด์
Committer์ ์ด๋ฆ, ์ด๋ฉ์ผ์ ๋ณ๊ฒฝํ๋ ๋ฐฉ๋ฒ์ด๋ค.
* ์ฃผ์ํ ์ ์ ์์ด๋, ์ด๋ฉ์ผ ์์ $์ ์ฌ์ฉํ์ง ์๋๋ค.
git filter-branch --env-filter '
if [ $GIT_COMMIT = ์ปค๋ฐ ID1 ] ||
[ $GIT_COMMIT = ์ปค๋ฐ ID2 ] ||
[ $GIT_COMMIT = ์ปค๋ฐ ID3 ]
then
export GIT_COMMITTER_NAME="์ํ๋ ID"
export GIT_COMMITTER_EMAIL="์ํ๋ EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
git filter-branch -f --env-filter '
if [ $GIT_COMMIT = c9487a021a930fe4e64a6425467fd5ac32fb219e ] ||
[ $GIT_COMMIT = 8f01743142ba72e3e15ec5d79d4804df66df2812 ] ||
[ $GIT_COMMIT = bac202c9abf2b30765a8b22928888ca0be29d3d7 ] ||
[ $GIT_COMMIT = 3810e5d9a5ed0464671ebaf62e9c2488a178598d ] ||
[ $GIT_COMMIT = b4ae165e784bad1df4d4a499597f57f73ebd0f6e ] ||
[ $GIT_COMMIT = dec4d0d04c37020add66733d1a2e9e7deca41242 ] ||
[ $GIT_COMMIT = bee2469629bf553ea023cd634a4037a3d9706d4b ]
then
export GIT_COMMITTER_NAME="yjyuwisely"
export GIT_COMMITTER_EMAIL="yjyuwisely@gmail.com"
fi
' --tag-name-filter cat -- --branches --tags
git filter-branch -f --env-filter '
if [ $GIT_COMMIT = ace20bb04315f0941473f012c2e286448f5b7300 ]
then
export GIT_COMMITTER_NAME=“GR”
export GIT_COMMITTER_EMAIL=“GR@gr.com”
fi
' --tag-name-filter cat -- --branches --tags
4.3) ํ๋จ์ Author์ Committer์ ์ด๋ฆ์ ์ผ์น์ํค๋ ์ฝ๋์ด๋ค.
git filter-branch --commit-filter '
if [ $GIT_COMMIT = ์ปค๋ฐ ID1] ||
[ $GIT_COMMIT = ์ปค๋ฐ ID2] ||
[ $GIT_COMMIT = ์ปค๋ฐ ID3] ||
[ $GIT_COMMIT = ์ปค๋ฐ ID4] ||
[ $GIT_COMMIT = ์ปค๋ฐ ID5] ||
[ $GIT_COMMIT = ์ปค๋ฐ ID6] ||
[ $GIT_COMMIT = ์ปค๋ฐ ID7]
then
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
fi
git commit-tree "$@"
' --tag-name-filter cat -- --branches --tags
git filter-branch --commit-filter '
if [ $GIT_COMMIT = 0e9a567c2c04c2d0c09df51b88950034b54c1666 ] ||
[ $GIT_COMMIT = 03a9f0e18c491d838b820d6b7daadfee6b238506 ] ||
[ $GIT_COMMIT = e0bc86ef3fa54d363a3ac5b39ad7a3932c5aa327 ] ||
[ $GIT_COMMIT = 8cc73d934734d138498a2e17fc646323e230c51d ] ||
[ $GIT_COMMIT = f3d60c7e98781bbdea6eee7580882432da24c55f ] ||
[ $GIT_COMMIT = f2f685918250bfe4c2e1f5518f5559518457da05 ]
then
export GIT_AUTHOR_NAME="$GIT_COMMITTER_NAME"
export GIT_AUTHOR_EMAIL="$GIT_COMMITTER_EMAIL"
fi
git commit-tree "$@"
' --tag-name-filter cat -- --branches --tags
git filter-branch --commit-filter '
if [ $GIT_COMMIT = 0d169a0c881586d95b8d9b367488fd054291964a ] ||
[ $GIT_COMMIT = 839ac762a6336bea854b4002529489446f41cae9 ] ||
[ $GIT_COMMIT = 4264efecfdb21af0eca6e0b2933acd44bb97caff ] ||
[ $GIT_COMMIT = ea68a9d2b51f8423b3f77cfbda466e9d0f9f6fd0 ] ||
[ $GIT_COMMIT = a8e63057e432df086989c9e474a672067dcdf861 ] ||
[ $GIT_COMMIT = a90046558c6c922c19b3978bb5b749c255163f45 ] ||
[ $GIT_COMMIT = 17acdb806d311df26bf06371f1a952b217f9f570 ] ||
[ $GIT_COMMIT = 9fcf391c4df3b3f005d7602513f07dd850864ca2 ] ||
[ $GIT_COMMIT = d57e6d04beec430205c575db394afe510365475a ] ||
[ $GIT_COMMIT = f2411507c7c43a854e78afb268dd33bd5703c9a2 ] ||
[ $GIT_COMMIT = 707aa5c25261aad307dfb1c0283e87dd095d088e ] ||
[ $GIT_COMMIT = fe573ca78cf31e2edc42e4769c9104bfd2df27b1 ]
then
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
fi
git commit-tree "$@"
' --tag-name-filter cat -- --branches --tags
5) ๋ง์ง๋ง์ผ๋ก, ํ๋จ์ ์ฝ๋๋ฅผ ์ ๋ ฅํ๋ค. ์์ ์ branch ์ด๋ฆ์ผ๋ก ์์ ํ๋ค.
์์) git push --force origin master
In summary, --env-filter is used to modify the commit environment variables, while --commit-filter is used to modify the commit object itself.
Instead of modifying the commit history using git filter-branch, you can consider using other methods such as git rebase or git commit --amend to change the author information on individual commits. These methods allow you to modify the most recent commits without rewriting the entire history.
'๐ปBootcamp Self-Study Revisionโจ > Git, GitHub' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
git push -u origin master (0) | 2023.07.26 |
---|---|
Git ๋ช ๋ น์ด ์ ๋ฆฌ ๋ ธํธ (0) | 2023.07.25 |
Git, Mac) ์ด๋ฏธ ์ปค๋ฐํ ์ฉ๋์ด ํฐ Repository์ ํ์ผ์ Committerย ์ด๋ฆ์ ์์ ํ ๊ฒฝ์ฐ (0) | 2023.06.10 |
Git, Mac) ์ด๋ฏธ ์ปค๋ฐํ Committer ์ด๋ฆ ํ๋์ฉ ๋ณ๊ฒฝํ๊ธฐ (0) | 2023.06.10 |