mac 개발자들이 git을 사랑하는 것 같다. 그래서 툴도 예쁜것도 나오고..

그러나 윈도우 환경에서는 아무리 돌아봐도 쉽지 않다.  git extension , git extension에 딸린 git bash 또는 cygwin이 현재까지는 git 도구로는 짱이다.

 

git bash는 git extension에 포함되어 설치할 수 있는 툴이다. 따로 cygwin 없이 git bash를 쓰면 편하다.

 

 

cygwin 기반 같은데. setup도 쉽게 할 수 없어서 참 불편하다.  cygwin-setup 같은 게 있어서 확장성을 높일 수 있었을 텐데…

 

cygwin에서는 git flow 를 설치하기 쉽긴 한데. git bash 에서는 쉽지 않다. 일일이 복사를 해야 한다.


git flow는 단순한 스크립트이다. shFlags라는 것을 기반위에 만들어진 스크립트라서 조금만 안다면 문제 해결은 쉽게 할 수 있다. 


이제 시작해 볼까나.. 우선 위치를 파악한다.

 

설치 순서를 확인한다.

http://knight76.tistory.com/entry/cygwin-%EC%97%90%EC%84%9C-git-flow-%EC%84%A4%EC%B9%98

 

install.exe 파일 때문에 설치 진행이 되지 않는다.

cygwin/bin/  밑에 아래 파일을 c:\program files\git\bin에 복사한다. 전부 install.exe 파일에 dependent가 있는 파일들이다.

install.exe     cygattr-1.dll    cygwin1.dll    cyggcc_s-1.dll    cygintl-8.dll   cygiconv-2.dll

 

 

설치하면 warning이 뜬다.  nodisfilewarning이라고 뜬다.

 

 

 

환경변수로 넣어준다.

 

 

git bash 창을 닫고 git bash를 다시 실행하고. 설치 순서로 설치한다.

 

 

 

이것으로 git flow 설치 완료가 완료되지 않는다.  

cygwin-setup에서 util패키지의 util-linux 바이너리를 설치하면 나오는 파일 getopt.exe 파일을 C:\Program Files\Git\bin에 복사 한다.  


나는 cygwin에서 gitflow를 설치했기 때문에 cygwin의 gitflow\shFlags\src  파일 밑에 있는 파일들을 찾아 C:\Program Files\Git\local\bin로 복사한다.  버전 이슈나 파일명이 달라질 수 있으니. git-flow 스크립트를 보면서 체크해볼 필요가 있다. 

만약 shflags를 못찾으면 아래 URL를 다운받고 C:\Program Files\Git\local\bin로 복사한다

https://raw.github.com/nvie/shFlags/master/src/shflags 


C:\Program Files\Git\bin\gitflow-shFlags 파일을 다음과 같이 수정한다. 


#shFlags/src/shflags

shflags


git flow init을 실행한다. 먼가 잘 돌아가는 것 같으면 Good!!

$ git flow init

Which branch should be used for bringing forth production releases?

   - feature-working-with-dbs

   - master

Branch name for production releases: [master]



아래와 같이 FLAGS command가 동작 안한다고 에러가 하면 손을 좀 봐야 한다.  FLAGS는 일종의 스크립트 라이브러로서 option을 잘 받도록 처리해준다. (이번 기회에 좋은 라이브러리를 알게 되었다.  나중에 써먹어야지.)

$ git flow init

c:\Program Files\Git\local\bin\git-flow: line 85: FLAGS: command not found

fatal: 'flow' appears to be a git command, but we were not

able to execute it. Maybe git-flow is broken?



리눅스 스크립트의 경우는 어디서라도 상대위치에 있는 shflags를 실행시키기 위해서는 파일을 하나 생성하고 그 곳에서 상대위치를 가르키게 한다. 그게 딱 gitflow-shFlags 파일이다. 


윈도우라 그런지 잘 동작이 안되서 나는 절대 위치로 고정해버렸다. git-flow 파일에 주석을 달고 절대위치를 넣었다. 


# use the shFlags project to parse the command line arguments

#. "$GITFLOW_DIR/gitflow-shFlags"

. ./"c:/Program Files/Git/local/bin/shflags"




git flow가 잘 돌아간다.. 


$ git flow init

Which branch should be used for bringing forth production releases?

   - feature-working-with-dbs

   - master

Branch name for production releases: [master]




Posted by '김용환'
,