옛날 옛날 한 옛날에.... 잠시 궁금했던 git clone 옵션들... [ bare / mirror ]


한 번 테스트 해본다고 마음 먹은지 몇 년만에 갑자기 하고 싶다는 의욕이 불끈! ... 은 거짓말이고

회사 업무 中 [ bare / mirror ]  옵션의 차이에 대한 문의가 있었고

이에 대해서 한 번 살펴보고 싶어졌다!!!


0. clone

    - 일단 무조건 clone 해봤다.

$ git clone git@github.com:tensorflow/tensorflow.git ./tensorflow-normal

Cloning into './tensorflow-normal'...

remote: Enumerating objects: 3, done.

remote: Counting objects: 100% (3/3), done.

remote: Compressing objects: 100% (3/3), done.

remote: Total 796000 (delta 0), reused 3 (delta 0), pack-reused 795997

Receiving objects: 100% (796000/796000), 453.08 MiB | 8.29 MiB/s, done.

Resolving deltas: 100% (643770/643770), done.

Checking out files: 100% (19052/19052), done.


$ du -hs ./tensorflow-normal
690M    ./tensorflow-normal


$ git clone --no-checkout git@github.com:tensorflow/tensorflow.git ./tensorflow-no

Cloning into './tensorflow-no'...

remote: Enumerating objects: 3, done.

remote: Counting objects: 100% (3/3), done.

remote: Compressing objects: 100% (3/3), done.

remote: Total 796000 (delta 0), reused 3 (delta 0), pack-reused 795997

Receiving objects: 100% (796000/796000), 453.51 MiB | 8.85 MiB/s, done.

Resolving deltas: 100% (643732/643732), done.


$ du -hs ./tensorflow-no
475M    ./tensorflow-no


$ git clone --bare git@github.com:tensorflow/tensorflow.git ./tensorflow-bare

Cloning into bare repository './tensorflow-bare'...

remote: Enumerating objects: 3, done.

remote: Counting objects: 100% (3/3), done.

remote: Compressing objects: 100% (3/3), done.

remote: Total 796000 (delta 0), reused 3 (delta 0), pack-reused 795997

Receiving objects: 100% (796000/796000), 455.34 MiB | 8.28 MiB/s, done.

Resolving deltas: 100% (643815/643815), done.


$ du -hs ./tensorflow-bare
477M    ./tensorflow-bare


$ git clone --mirror git@github.com:tensorflow/tensorflow.git ./tensorflow-mirror

Cloning into bare repository './tensorflow-mirror'...

remote: Enumerating objects: 1124, done.

remote: Counting objects: 100% (1124/1124), done.

remote: Compressing objects: 100% (1116/1116), done.

remote: Total 1055983 (delta 805), reused 21 (delta 8), pack-reused 1054859

Receiving objects: 100% (1055983/1055983), 1.09 GiB | 8.69 MiB/s, done.

Resolving deltas: 100% (783532/783532), done.


$ du -hs ./tensorflow-mirror
1.2G    ./tensorflow-mirror



1. 정리

    - 위 내용을 표로 정리하면 아래와 같다.


구분 

 normal

 --no-checkout

--bare 

--mirror 

objects 

796,000 

796,000 

796,000 

1,055,983 

Receiving Size 

453.08 MiB 

453.51 MiB 

455.34 MiB 

1.09 GiB 

du Size 

690 M 

475 M 

477 M 

1.2 G 



2. 도식화

    - 위의 상황을 그림으로 설명해보면 아래와 같다.




3. 설명

    - normal

        . 당연히 commit 이력을 모두 담고 있고, 거기에다가 기본 branch로 설정된 소스코드가 working tree에 존재하게 된다.

    - no-checkout

        . commit 이력을 모두 담고 있고, 아직은 working tree에 소스코드를 넣어놓지는 않은 상태다.

    - bare

        . commit 이력만 담고 있다

    - mirror

        . 일반적인 commit 이력뿐만 아니라, 숨어있는(?) 모든 이력들을 담고 있다.


    # 적고나니 이게 뭔 설명인가 싶네.... ^^



4. 차이점 살펴보기

    - normal vs no-checkout

        . HEAD가 가리키는 기본 branch의 latest commit으로 checkout 했냐/안했냐의 차이만 있다.

        . no-checkout으로 clone 한 뒤에 "git checkout -b master"를 하면 결국 똑같다.


    - normal vs bare

        . bare 옵션으로 clone을 하는 것은 개발을 하고자 하는 용도가 아니다. 그러므로 working tree는 없다.

        . normal clone을 했을 때 ".git" 디렉토리 부분만 있는 것이 bare 옵션이기 때문이다.

$ diff ./tensorflow-bare/config ./tensorflow-normal/.git/config

4c4,5

<       bare = true

---

>       bare = false

>       logallrefupdates = true

6a8,11

>       fetch = +refs/heads/*:refs/remotes/origin/*

> [branch "master"]

>       remote = origin

>       merge = refs/heads/master

        . 위의 차이를 보면 알겠지만, bare 옵션으로 clone을 하게 되면 remote를 바라보지 않는다


    - bare vs mirror

        . mirror 옵션은 현재 서버에 기록된(?) 모든 사항을 전부 가져오게 된다.

$ nano ./tensorflow-mirror/packed-refs

# pack-refs with: peeled fully-peeled sorted

4be56f381cd000e91f79209aaf150636db6fb840 refs/heads/0.6.0

...

45e1e4598d3ebab316bf87df9160656f524af36c refs/heads/master

e1c85596366f3133c797f153dac34e01589a231f refs/pull/10000/head

c2d4f5e964503d17107123e51139aa8bbf27c57c refs/pull/10007/head

29d57e0360306de6bc9021eec4b633e96f3549f5 refs/pull/10008/head

ad9e6a95e53a4407db44e0436fc5318522e832cf refs/pull/10011/head

...

        . bare 옵션의 경우에는 "refs/heads/*" 항목만 보이지만,

        . mirror 옵션의 경우에는 "refs/pull/*" 항목도 보인다.

        . GitHub에서 Pull-Request를 할 때 사용되는 commit들이 기록되는 위치가 바로 "refs/pull/*" 이다.



위의 내용에 대해서 잘 생각해보고 용도에 맞춰서 잘 사용하기 바란다~


반응형


Ubuntu에서 Python3 환경 셋업을 한 뒤에 (https://www.whatwant.com/entry/Python3-환경-만들기-버전-변경하기-in-Ubuntu)

pandas를 사용해보고자 했더니, 에러가 발생...


Traceback (most recent call last):

  File "./test.py", line 4, in <module>

    import pandas as pd

ModuleNotFoundError: No module named 'pandas'




0. 현재 환경


    - 아래 작업을 실행한 환경은 다음과 같다


$ lsb_release -a


No LSB modules are available.

Distributor ID: Ubuntu

Description:    Ubuntu 18.04.3 LTS

Release:        18.04

Codename:       bionic



$ python --version


Python 3.6.9


    - Python 3.7 버전으로 했을 경우에는 아래와 같이 진행하면 충돌(?)이 있다. 3.6 버전으로 진행하길...




1. pandas 설치하기


    - 뭔가 무지막지하게 많이 설치된다.


$ sudo apt-get install python3-pandas


Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  blt fonts-lyx javascript-common libaec0 libblas3 libblosc1 libgfortran4 libhdf5-100 libjbig0 libjpeg-turbo8 libjpeg8 libjs-jquery libjs-jquery-ui liblapack3 liblcms2-2 libsnappy1v5 libsz2 libtcl8.6 libtiff5 libtk8.6 libwebp6 libwebpdemux2

  libwebpmux3 libxft2 libxrender1 libxss1 python-matplotlib-data python-tables-data python3-bs4 python3-cycler python3-dateutil python3-decorator python3-html5lib python3-lxml python3-matplotlib python3-numexpr python3-numpy python3-olefile

  python3-pandas-lib python3-pil python3-pyparsing python3-scipy python3-tables python3-tables-lib python3-tk python3-tz python3-webencodings tk8.6-blt2.5 ttf-bitstream-vera x11-common

Suggested packages:

  blt-demo apache2 | lighttpd | httpd libjs-jquery-ui-docs liblcms2-utils tcl8.6 tk8.6 python-cycler-doc python3-genshi python3-lxml-dbg python-lxml-doc dvipng ffmpeg gir1.2-gtk-3.0 ghostscript inkscape ipython3 librsvg2-common

  python-matplotlib-doc python3-cairocffi python3-gi-cairo python3-gobject python3-nose python3-pyqt4 python3-sip python3-tornado texlive-extra-utils texlive-latex-extra ttf-staypuft gfortran python-numpy-doc python3-dev python3-numpy-dbg

  python-pandas-doc python-pil-doc python3-pil-dbg python-pyparsing-doc python-scipy-doc python-tables-doc python3-netcdf4 vitables tix python3-tk-dbg

The following NEW packages will be installed:

  blt fonts-lyx javascript-common libaec0 libblas3 libblosc1 libgfortran4 libhdf5-100 libjbig0 libjpeg-turbo8 libjpeg8 libjs-jquery libjs-jquery-ui liblapack3 liblcms2-2 libsnappy1v5 libsz2 libtcl8.6 libtiff5 libtk8.6 libwebp6 libwebpdemux2

  libwebpmux3 libxft2 libxrender1 libxss1 python-matplotlib-data python-tables-data python3-bs4 python3-cycler python3-dateutil python3-decorator python3-html5lib python3-lxml python3-matplotlib python3-numexpr python3-numpy python3-olefile

  python3-pandas python3-pandas-lib python3-pil python3-pyparsing python3-scipy python3-tables python3-tables-lib python3-tk python3-tz python3-webencodings tk8.6-blt2.5 ttf-bitstream-vera x11-common

0 upgraded, 51 newly installed, 0 to remove and 0 not upgraded.

Need to get 35.7 MB of archives.

After this operation, 160 MB of additional disk space will be used.

Do you want to continue? [Y/n]




2. 테스트 코드


    - 잘 동작하는지 살펴보자. 샘플은 Kaggle의 내용을 참조했다.


import pandas as pd

import pprint


pp = pprint.PrettyPrinter(indent=4)


if __name__ == "__main__":


    fruits = pd.DataFrame( [[30, 21]], columns=['Apples', 'Bananas'] )

    pp.pprint( fruits )


    exit(0)


파이팅~!!!

반응형


Billie Eilish - bad guy






라이브





비긴어게인






비긴어게인3을 보다가 어디서 많이 들어본 노래인데... 갑자기 확 끌려서 찾아본 노래...

빌리 아일리쉬라는 2001년생 미국 여성 가수의 노래.


상당히 독특한 캐릭터를 갖고 있는 가수다.

신체 이형 장애, 투렛 증후군, 유당 불내증, 글루텐 알러지 등의 많은 병을 갖고 있고

학업도 홈스쿨링으로 하고 있다.

이러한 배경에다가 공포 영화를 좋아하는 취향 덕분인지

음악에도 이러한 색깔이 많이 묻어나있으며

특히 뮤비는... 정말이지...



반응형


Python version.2 지원이 끝난다고 하니

이제는 Python version.3 환경을 기본으로 사용해야할 것 같다.


Ubuntu를 설치하면 기본적으로 셋팅되어 있는 Python은 version.2 이다.


이를 변경하여 Python version.3 환경으로 꾸며 보고자 한다.




0. 기본 환경


    - Ubuntu 설치가 된 깨끗한(?) 환경이다.


$ lsb_release -a


No LSB modules are available.

Distributor ID: Ubuntu

Description:    Ubuntu 18.04.3 LTS

Release:        18.04

Codename:       bionic



$ python --version


Python 2.7.17




1. python3 상태 확인


    - 어?! 그런데, 살펴보면 python3도 이미 설치되어 있다.


$ python3 --version


Python 3.6.9


    - 뭐뭐가 있는지 한 번 보자


$ ls /usr/bin/ | grep python


dh_python2

python

python-config

python2

python2-config

python2.7

python2.7-config

python3

python3.6

python3.6m

python3m

x86_64-linux-gnu-python-config

x86_64-linux-gnu-python2.7-config




2. python 3.7 설치하기


    - 추가로 Python 3.7 버전을 설치해보자


$ sudo apt-get install python3.7


Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  libpython3.7-minimal libpython3.7-stdlib python3.7-minimal

Suggested packages:

  python3.7-venv python3.7-doc binfmt-support

The following NEW packages will be installed:

  libpython3.7-minimal libpython3.7-stdlib python3.7 python3.7-minimal

0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.

Need to get 4,282 kB of archives.

After this operation, 22.5 MB of additional disk space will be used.

Do you want to continue? [Y/n]


    - 잘 설치되어 있는지 확인 !


$ python3.7 --version


Python 3.7.5



$ ls /usr/bin/ | grep python


dh_python2

python

python-config

python2

python2-config

python2.7

python2.7-config

python3

python3.6

python3.6m

python3.7

python3.7m

python3m

x86_64-linux-gnu-python-config

x86_64-linux-gnu-python2.7-config




3. Python 버전 등록


    - 기본적인 설정이 등록되어 있는지 확인하여 보자


$ sudo update-alternatives --config python


update-alternatives: error: no alternatives for python


    - 기본 정보를 차례대로 등록해보자


$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1


update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode



$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2


update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python (python) in auto mode



$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 3


update-alternatives: using /usr/bin/python3.7 to provide /usr/bin/python (python) in auto mode




4. Python 버전 설정


    - 위에서 기본적으로 등록을 했으니... 실제 확인


$ sudo update-alternatives --config python


There are 3 choices for the alternative python (providing /usr/bin/python).


  Selection    Path                Priority   Status

------------------------------------------------------------

* 0            /usr/bin/python3.7   3         auto mode

  1            /usr/bin/python2.7   1         manual mode

  2            /usr/bin/python3.6   2         manual mode

  3            /usr/bin/python3.7   3         manual mode


Press <enter> to keep the current choice[*], or type selection number: 0



$ python --version


Python 3.7.5


    - 이제, "python" 이라는 이름으로 버전 확인을 하면 '3.7.5'가 나온다 !!!



그런데, 3.7 버전으로 했을 경우에.... 뭔가 신경써야할 것들이 많은 것 같다 !! (라이브러리 관리가 쉽지 않다는...)

Ubuntu에서는 현재 3.6 버전을 기본으로 제공하고 있으니 이를 따라서 3.6 버전으로 가는 것을 추천한다.



모두 수고하셨어욥~!!


반응형


레트로 트랜드에 따라 (응?! 핑계?! 으..응?!)

오래전 PS2 게임들을 하나씩 해보고 있다.



이번 주에 해본 게임은 "Fatal Frame (영 제로)"




너무나 잘 정리되어 있는 나무위키

    https://namu.wiki/w/영%20제로




오래전 PS2 작품이라서 그런지 해상도가 안습이지만... 그래도 트레일러도 있다!!!






한글판 발매를 한 착한 타이틀이다.


2002년 08월 31일에 자막 한글화로 발매!!!




게임의 스토리는 뭐 이렇다.


은사님이 행방불명 되어 한 남성이 어떤 무서운 집에 찾아갔는데,

그 남성도 행방불명이 되어

그 남성의 여동생이 오빠를 찾아 그 무서운 집에 찾아갔다는...



난 처음에 나온 그 남자가 여자인줄로만 알았다 ^^

(트레일러 영상의 앞 부분을 보면 무슨 말인줄 알 수 있을거다!!)





잘 하지도 않는것 괜히 사놓고 먼지만 쌓인다고

와이프님이 타박하던

나의 PS2 게임기~~~!!!



그런데, 거실에서 하자니 영~ 눈치가 보여서...



그래서, PCSX2 에뮬레이터로 실행해봤다.



우와~~~ 엄청 잘 된다 !!!



누가봐도 여성 캐릭터로 보이지 않나!?


하지만,

오빠다!!!




에뮬레이터로 잘 안되면

PS2 본체를

내 방으로 가져와 모니터 연결하려고 했더니...


PCSX2 ... 너무 훌륭하다!!!




거기에다가 예전에 알리익스프레스로 구매한 조이스틱까지 연결을 하니까...

이건 너무나 훌륭한 환경 !!!


(물론 조이스틱의 상태가 조금 이상하긴 하지만...^^)





다시 게임 이야기로 좀 돌아가보자



"영 제로"

테크모에서 만든 아주 유명한 호러 게임인데...


그냥 호러 게임이 아니라


"셔터 호러" 장르로 불리운다



게임에 귀신이 나오면 사진기로 찍어서 무찌르기 때문이다.



사실은 출시할 때 광고 문구가

"절체절명 셔터 호러"

였기 때문에... ^^



게임에서

"사영기"

라는 이름으로 불리우는

사진기를 가지고

원령들도 물리치고

힌트도 얻으며 진행하면 된다.




게임은 자유도 거의 없는 스토리대로 진행하는 방식이고

원령들 나오면 액션 게임처럼 사진 찍어대고...

중간 중간 나오는 퍼즐 풀고 하면서 진행하면 된다.


엔딩이 멀티엔딩이라고 한다.

108 원령을 다 모으기도 있다는...



음... 꾸준히 한 번 해볼 계획이다~!!




반응형


Git 저장소를 오래 운영하다보니

호스팅하고 있는 서버의 스토리지가 부족한 일이 종종 발생한다. (Gerrit 또는 GitHub Enterprise)


(대체 왜 자꾸 바이너리를 올리는 것인지... 우이쒸~!!)



스토리지를 팍팍 늘리면 좋겠지만... 우리는 가난하기에.. ^^



이럴 때 보통 "git gc"를 실행하곤 하는데...

이게 성능/효과가 얼마나 있는지 실험을 해보고 싶었다!!!



0. target


    - 실험할 repo가 필요해서 찾던 中 최근 유명한 tensorflow를 대상으로 정했다.


$ git clone --bare https://github.com/tensorflow/tensorflow.git


    - 저장공간을 줄이는 것에 대한 실험이니만큼 "--bare" 옵션으로 clone 하였다.


$ du -hs ./

455M    ./


    - 기본 저장 공간은 "455M"




1. [ git gc --aggressive ]


    - 가장 기본적으로 사용하는 옵션으로 해봤다. (오래걸렸다)


$ time git gc --aggressive

Counting objects: 769698, done.

Compressing objects: 100% (760700/760700), done.

Writing objects: 100% (769698/769698), done.

Total 769698 (delta 636704), reused 111483 (delta 0)

Checking connectivity: 769698, done.


real    41m45.048s

user    28m54.865s

sys     0m3.769s


$ du -hs ./

243M    ./







2. [ git gc --aggressive --prune=now ]


    - 구글링을 했더니, 안전하게 그리고 확실하게 gc를 하는 방법이라고 되어있는 2단계 실행법이다.

        . reflog는 "git rebase" 같은 작업을 하다가 발생하는 끈 떨어진(?) log들에 대한 정보이다.


$ git reflog expire --expire=now --all


$ time git gc --aggressive --prune=now

Counting objects: 769698, done.

Compressing objects: 100% (760700/760700), done.

Writing objects: 100% (769698/769698), done.

Total 769698 (delta 636704), reused 111483 (delta 0)

Checking connectivity: 769698, done.


real    41m17.315s

user    28m51.873s

sys     0m3.522s


$ du -hs ./

243M    ./






뭐 결론은 2번 방법으로 실행하면 되겠다~!!!

안전한게 짱이지~!!


조금은 실망~


반응형



최근 회사에서 Credential 내역이 노출되어 보안 위협이 된 사례가 발생을 하였다.


즉, 아이디/패스워드, AWS 토큰 값들을 소스파일 안에 적어놓고

그것을 그대로 commit 하여 push 까지 해버린 것이다.



그래서, 소스코드에 이러한 Credential 정보가 들어있는지 점검하는 것을 강화하였다.

자동으로 분석하도록 한 것이다.



문제는 이러한 Credential 정보가 들어있는 파일을 발견했을 때

개발자들이 어떻게 조치를 취해야하는지에 대한 가이드가 부재하고 있다는...





1. 기본 배경


    - 개발자들이 특정 API 사용을 위한 인증 정보를 파일에 적어놓고 무심코 commit을 했을 경우를 전제 해보자

    - 즉, 아래 그림과 같이 "commit D"에 token 값이 있다는 것을 발견한 것이다!!!



2. 최악의 해결 방법


    - Credential 정보가 발견되었다는 경고를 받은 개발자는 당황한 나머지 아래와 같이 작업을 할 수 있다.


    - 설마! 라고 하지만 정말로 저렇게 할 수 있다 !!!

    - 위와 같이 하면 "commit E"에서는 Credential 정보가 안보이지만, "commit D"로 checkout을 하면 볼 수 있게 되기에 해결책이 아니다 !!!!!




3. 기본적인 해결 방법


    - 실습을 위해 아래와 같이 실제 commit들을 만들어보았다.



    - 마지막 commit인 "2651682"에서 Credential 정보가 발견되었을 경우에 대한 대처법을 알아보자.


$ git clone git@github.com:whatwant/whatwant.git

Cloning into 'whatwant'...

remote: Enumerating objects: 8, done.

remote: Counting objects: 100% (8/8), done.

remote: Compressing objects: 100% (4/4), done.

Receiving objects: 100% (11/11), done.

Resolving deltas: 100% (2/2), done.

remote: Total 11 (delta 2), reused 8 (delta 2), pack-reused 3



$ cd whatwant/



$ git log --oneline

2651682 (HEAD -> master, origin/master, origin/HEAD) write token in no002.txt

a2004f0 add no002.txt

93afc28 add no001.txt

2b73c6e Initial commit



$ git reset --hard HEAD^

HEAD is now at a2004f0 add no002.txt



$ git log --oneline

a2004f0 (HEAD -> master) add no002.txt

93afc28 add no001.txt

2b73c6e Initial commit



$ git push origin master

To github.com:whatwant/whatwant.git

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to 'git@github.com:whatwant/whatwant.git'

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.



$ git push -f origin master

Total 0 (delta 0), reused 0 (delta 0)

To github.com:whatwant/whatwant.git

 + 2651682...a2004f0 master -> master (forced update)


    - 위와 같이 진행하고 commit 현황을 보면 "2651682" commit이 사라진 것을 볼 수 있다.



    - 아래 그림과 같이 표현할 수 있을 것이다



    - "git reset"은 매우 위험한 명령이기에 그냥 push를 하고자 하면 reject을 당한다! 그래서 "-f" 옵션을 통해 force 실행해야 한다!!!



4. 특정 파일의 이력을 모두 삭제하는 방법


    - 이번 포스팅을 하게 된 이유이다 !!!



    - 위와 같이 commit들이 있다고 해보자. 그림으로 표현하면 아래와 같다.



    - 즉, 예전에 이미 Credential 정보를 넣었는데... 불행하게도 뒤늦게 (이미 commit들이 쌓이고 난 뒤에) Credential 정보를 발견하게 된것이다.

    - 문제가 된 파일과 관련된 모든 이력을 지워보자.


$ git clone git@github.com:whatwant/whatwant.git

Cloning into 'whatwant'...

remote: Enumerating objects: 9, done.

remote: Counting objects: 100% (9/9), done.

remote: Compressing objects: 100% (7/7), done.

Receiving objects: 100% (13/13), done.

Resolving deltas: 100% (3/3), done.

remote: Total 13 (delta 3), reused 7 (delta 1), pack-reused 4



$ cd whatwant/



$ git log --oneline

d81bb67 (HEAD -> master, origin/master, origin/HEAD) add no003.txt

df3c9e0 write token in no002.txt

ea11c2d add no002.txt

83bc6a8 add no001.txt

2b73c6e Initial commit


$ git filter-branch --tree-filter "rm -f no002.txt" HEAD

Rewrite d81bb67affec459cd3e25fa57b98cf64a1bf05be (3/5) (1 seconds passed, remaining 0 predicted)

Ref 'refs/heads/master' was rewritten



$ ls -al

total 9

drwxr-xr-x 1 chani 197121  0 11월  9 20:41 ./

drwxr-xr-x 1 chani 197121  0 11월  9 20:40 ../

drwxr-xr-x 1 chani 197121  0 11월  9 20:41 .git/

-rw-r--r-- 1 chani 197121  0 11월  9 20:40 no001.txt

-rw-r--r-- 1 chani 197121  0 11월  9 20:40 no003.txt

-rw-r--r-- 1 chani 197121 10 11월  9 20:40 README.md



$ git log --oneline

69c84e3 (HEAD -> master) add no003.txt

94413d9 write token in no002.txt

1a2d568 add no002.txt

83bc6a8 add no001.txt

2b73c6e Initial commit



$ git push origin master

To github.com:whatwant/whatwant.git

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to 'git@github.com:whatwant/whatwant.git'

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.



$ git push -f origin master

Counting objects: 4, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (4/4), done.

Writing objects: 100% (4/4), 515 bytes | 515.00 KiB/s, done.

Total 4 (delta 1), reused 0 (delta 0)

remote: Resolving deltas: 100% (1/1), done.

To github.com:whatwant/whatwant.git

 + d81bb67...69c84e3 master -> master (forced update)


    - 실제 commit이 어떻게 되어있는지 확인해 보자.



    - 무엇이 바뀌었는지 그림으로 확인해 보자.



    - 위의 방법은 문제가 발생한 파일과 관련한 내용을 전체 히스토리에서 삭제를 하는 것이다.

      → 그렇기 때문에, 영향을 받은 commit을 보면 앞의 commit 까지 포함이 된다.





※ 주의사항


    - 문제가 발생한 정확한 위치를 찾기가 어렵기 때문에 문제가 발생한 파일을 전체 history에서 삭제를 해버리는 방식이다.

      → 해당 파일에 Credential 정보 외의 내역도 있고 이에 대한 내용도 중요하다고 하면 문제가 있을 수 있는 방법이라는 말이다.


    - 그리고, 기존 commit ID 값도 변경이 된다.

      → commit ID 이력을 관리하고 있는 상황인 경우 문제가 있을 수 있다는 말이다.




이러한 번거로움을 피하기 위해서는 애초에 Credential 정보를 파일안에 기재하는 일이 없어야 하겠다.



반응형


얼마전 할아버지 맥북-프로 중고를 구매했다.


내가 원하는 개발환경 구축에는 실패했지만,

이 할아버지를 현역으로 연명시켜주고 싶었다.


그러던 중 최근에 macOS 카탈리나 버전이 나왔다는 소식을 접하게 되었는데,

당연하게도 우리 할아버지 mid 2010 맥북프로는 지원을 하지 않았다.


그러던 중...

이러한 할아버지들을 위한 Patcher가 있다는 이야기를 듣게 되었다.


빙고!!!


필자의 맥북은... Mid 2010 맥북프로 이다.


0. USB 메모리 준비

    - Catalina 설치용 USB를 만들어야 하기에 메모리가 필요하다!!!


1. Patcher 다운로드

    - 우리 할아버지에서 아래 사이트를 통해 patcher 이미지를 다운로드 받자.

        . http://dosdude1.com/catalina/



2. Patcher 실행하기 #1

    - 다운로드 받은 Patcher를 실행하자


    - 권한이 필요할 수도 있다

3. Patcher 실행하기 #2

    - 이제 순탄히 진행하면 된다

    - 설치 이미지를 만들기 위해 Catalina 파일이 필요한데... 가지고 있으면 고르면 되고, 없으면 다운로드 받으면 된다. 시간 좀 걸린다.

4. Patcher 실행하기 #3

    - 다운로드 받은 Catalina 이미지 파일을 이용해서 설치용 USB 메모리를 만들면 된다

    - "Create a Bootable Installer" 메뉴를 선택하고,

    - USB 메모리 (필자는 뒤에 있는 "Untitled") 선택하면

    - USB 메모리 내용이 다 지워질 수도 있다는 내용 확인하면 된다

    - 시간이 좀 많이 소요된다 (필자의 USB 메모리가 느려서일지도?!)


5. 재부팅

    - 이제 재부팅을 하면 된다. Option키를 눌러서 부팅 옵션을 고르는 화면을 보면 된다.


6. 디스크 유틸리티

    - Catalina의 경우 APFS 파일시스템을 사용해야 한다고 한다. 그래서 "디스크 유틸리티"를 선택하면 된다.

    - 필자는 SSD + HDD 구성이기에 SSD 일부 공간을 APFS로 할당했다.

    - 반절만 할당해봤다.


7. Catalina 설치

    - 파티션 잡아줬으면, 빠져나와서 "macOS 다시 설치"를 선택하면 된다.

    - 그냥 고고씽~ 하면 된다.

    - 당연히 방금 만들어준 APFS를 설정한 디스크를 골라주면 된다.

    - 느린 USB 메모리 때문인지, 할아버지 맥북이라서인지.... 소요시간은 좀 걸렸다.

    - 1분 남았다고 거짓말 하는 우리 할아버지...

    - 대한민국 잘 골라주면 된다~

    - 개발자라면 다크 모드 !!!

    - Mid 2010 이지만... Catalina 이다~!!!


음... 솔직히 뭐가 좋아졌는지는 잘 모르겠다.

그냥 최신 macOS 사용할 수 있으니 좋을뿐~ ^^


개인적으로는 살짝 느린맛이 있기도 한데... 빨라졌다는 분들도 있는 것 보면... 뭐...


일단 여하튼 우리 할아버지 맥북프로님이 새로운 트렌드에 맞는 옷을 입었어요 !!!


반응형

+ Recent posts