먼저 git flow를 설치한다.
http://knight76.tistory.com/entry/cygwin-에서-git-flow-설치
http://knight76.tistory.com/entry/윈도우-Git-Bash에-Git-flow-설치-installation-할-수-있도록-하는-팁
master 만 사용하고 있는 경우를 근거로 설명한다. (다른 branch들이 존재할 때는 어떻게 해야 할지 몰라서.. 그냥 이렇게 했음. 마침 다른 branch도 안쓰고 있어서.. )
git flow init 실행하고 디폴트로 실행 (master branch였음)
$ git flow init
Branch name for "next release" development: [develop]
How to name your supporting branch prefixes?
Feature branches? [feature/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []
cygwin 화면에서 develop으로 변경되었음을 확인할 수 있다.
$ git branch
* develop
master
이제 하고 싶은 기능을 추가한다. feature 등록
$ git flow feature start feature-30table-integration
……
Switched to a new branch 'feature/feature-30table-integration'
Summary of actions:
- A new branch 'feature/feature-30table-integration' was created, based on 'develop'
- You are now on branch 'feature/feature-30table-integration'
Now, start committing on your feature. When done, use:
git flow feature finish feature-30table-integration
$ git branch
develop
* feature/feature-30table-integration
master
열심히 코딩 작업을 한고 난 후, commit과 push를 실행한다.
$ git add .
$ git commit -m 'added ...'
$ git push
기능을 종료하면 finish 한다. 그러면 자동으로 develop branch로 머징이 되고. feature 는 삭제된다.
$ git flow feature finish feature-30table-integration
Switched to branch 'develop'
Updating 6db00ac..aa6072b
Fast-forward
.............
9 files changed, 1009 insertions(+), 98 deletions(-)
create mode 100644 src/main/resources/search.sql
Deleted branch feature/feature-30table-integration (was aa6072b).
Summary of actions:
- The feature branch 'feature/feature-30table-integration' was merged into 'develop'
- Feature branch 'feature/feature-30table-integration' has been removed
- You are now on branch 'develop'
이와 비슷한 과정으로 다양한 sub command가 존재한다.
$ git flow release start release-……
$ git flow hotfix start release-……
$ git flow support start release-……
Posted by 김용환 '김용환'
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 김용환 '김용환'
* 계정 env 정보
LC_ALL=ko_KR.UTF-8
LANG=ko_KR.UTF-8
* ~/.vimrc
set encoding=UTF-8
set fencs=ucs-bom,utf-8,cp949
* Secure CRT 터미널 설정

character encoding 설정을 UTF-8,
Use unicode line-drawing characters 의 check box를 on으로 설정 (이걸 안해서 삽질)
* 데몬 재시작
Posted by 김용환 '김용환'
<git add 후 취소>
git rm --cached 파일이름
<modified file 표시 안하기/취소하기>
git checkout -- <filename>
<update>
git pull origin master
<branch / tag 목록 다운받기 >
git fetch
<마지막 commit 보기>
git show
<commit 정보 확인>
git log
<tag 보기>
git tag –l
<모든 branch 보기 >
git branch -a 또는 git branch -r 또는 git remote show origin 또는 git ls-remote --heads origin
<만들었던 local branch 삭제>
git branch -D [help]
<프로젝트 생성후 처음 push할 때>
git push -v --all origin
<커밋하기>
git commit -a -m "bug fixed"
git push sv
<모르고 파일 삭제/추가했을때, 원복하기>
git reset --hard HEAD
git pull
** commit 은 이미 해버렸을 때.
git reset HEAD^
<target 디렉토리가 git 소스에 commit되어 있어서 날리기>
git rm -r --cached <your directory>
.gitignore 파일을 이용해서 정리할 필요있음
<rollback 하기>
git log
(commit 넘버 확인)
git reset --hard (commit 넘버)
<두 사람이 작업하다가 conflict 날 것 같으면, 작업하던 것을 임시저장(stash) 함>
git stash save "work in progress"
git pull
git stash apply
git commit -m '11'
<rebase – merge 가 좀 더 좋아짐>
git rebase
- merge될 대상 branch를 다운받기 git checkout ..
- git rebase merge할 소스
<crlf 적용>
git config core.autocrlf false
<devolop으로부터 branch 하나 따기>
git checkout -b feature-old-deletion master
(소스 수정)
git commit -a -m "Rearrange old api"
git push origin : feature-old-deletion
<소스 검색>
git grep string
grep보다 빠르다.
<submodule>
git submodule update --init --recursive
Posted by 김용환 '김용환'
maven 빌드는 성공하는데, eclipse의 maven build가 되지 않고,
maven dependencies references non existing library 에러가 발견되었다.

이클립스 프로젝트 설정의 Maven->Update Dependencies를 선택해보고 기다리니.. 문제 해결!!

Posted by 김용환 '김용환'
# vi /etc/profile
LANG=ko_KR;export LANG
alias ls='ls -F --show-control-chars --color=tty'
logout->login 하면 한글 깨지는 이슈 사라진다.
Posted by 김용환 '김용환'
synergy는 노트북, pc 뿐의 확장 뿐 아니라 다양한 운영체제에서의 키보드, 마우스 콘트롤을 제어할 수 있다.
다시는 안쓸 줄 알았는데.. 반드시 출장 때문에 노트북을 주로 써야하는 상황이 되었다..
synergy-foss.org/
최신 버전이 이해하기도 UI가 가장 좋은 것 같다. 현재 1.4.7 beta로 이용 결정
호스트 이름이 한글이어서 먼저 영문으로 변경
http://blog.naver.com/PostView.nhn?blogId=umhyun2&logNo=70097727903&viewDate=¤tPage=1&listtype=0
같은 네트웍이 아니면, 연결자체가 되지 않음. 클라이언트에서는 IP로 변경
http://songhl1.tistory.com/181
좋은 설명은 여기로
http://jwmx.tistory.com/833
http://adnoctum.tistory.com/562
한글/영문 변환 패치 (1.4.7 beta)
http://divestudy.tistory.com/15
(서버의 경우 nt service로 지정했을때 dll 파일을 덮어 쓸 수 없다. service off 하던가 unlocker를 이용해서 overwrite 해주면 됨)
Posted by 김용환 '김용환'
외국 웹 문서를 번역하기 위해서 매번 구글 번역기에 들어가지 않아도 되는 방법.
구글 크롬 브라우져의
Auto-Translate extension 설치하면 외국 웹 문서를 웹에서 바로 볼 수 있다.
구글 크롬에서 옵션-확장프로그램Auto-Translate-옵션 에서 from을 japanese로 수정하고, first,second를 모두 japanese로 변경하면 일본어->한국어로 쉽게 볼 수 있다.
[##_http://knight76.tistory.com/script/powerEditor/pages/1C%7Ccfile23.uf@124E2E4B4F5EE8741D76E1.PNG%7Cwidth=%22600%22%20height=%22435%22%20alt=%22%22%20filename=%222.PNG%22%20filemime=%22image/jpeg%22%7C_##]
control 키를 누르고 스크롤 하면 아래와 같이 한글로 번역되는 것을 볼 수 있다.
[##_http://knight76.tistory.com/script/powerEditor/pages/1C%7Ccfile9.uf@134E2E4B4F5EE8741EBD9A.PNG%7Cwidth=%22406%22%20height=%22253%22%20alt=%22%22%20filename=%223.PNG%22%20filemime=%22image/jpeg%22%7C_##]
Posted by 김용환 '김용환'
댓글을 달아 주세요