manywaypark's Blog
개발, 검색, 함수

git flow

tips & tricks 2012. 12. 21. 01:08 by manywaypark

git flow를 쓰면 개발 과정에서 좀더 체계적으로 git을 활용할 수 있다.


refs:

https://github.com/nvie/gitflow/wiki/Installation

http://nvie.com/posts/a-successful-git-branching-model/

http://knight76.tistory.com/entry/Git-Flow-%EC%A2%8B%EC%9D%80-%EC%9E%90%EB%A3%8C

http://yakiloo.com/getting-started-git-flow/


happy hackin'

gitosis 사용하기

카테고리 없음 2012. 3. 20. 13:52 by manywaypark
설치/계정설정
$ sudo apt-get install git-core gitosis
$ sudo adduser \
    --system \
    --shell /bin/sh \
    --gecos 'git version control' \
    --group \
    --disabled-password \
    --home /home/git \
    git

admin key 등록
(optional) public key가 없으면 ssh-keygen으로 생성.
sudo -H -u git gitosis-init < /tmp/id_rsa.pub
sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update


설정
% id_rsa.pub를 가져온 box의 계정에서...
$ git clone git@YOUR_HOSTNAME:gitosis-admin.git
$ cd gitosis-admin

key(user) 추가
$ cp /path/to/key.pub keydir/

gitosis.conf 내용 추가
[group GROUP_NAME]
members = KEY_FILE_NAME(w/o .pub)
writable = project1 project2


project 생성

$ mkdir project1
$ cd project1
$ git init
$ git remote add origin git@YOUR_HOSTNAME:project1.git
% add or edit file(s).
$ git add *
$ git commit -m "some stuff"
$ git push origin master:refs/heads/master

refs:
http://www.howtoforge.com/setting-up-gitosis-on-ubuntu
https://help.ubuntu.com/community/Git
http://www.mantisbt.org/wiki/doku.php/mantisbt:gitosis_management

happy hackin'


macport에서 git-svn 쓰기

카테고리 없음 2012. 3. 12. 17:10 by manywaypark
windows의 cygwin에서는 git-core package만 설하면 git-svn도 같이 설치되어 편하게 사용할 수 있었는데, mac의 macport에서는 git-core만 설치하면 git-svn이 설치되지 않는다.
다음과 같이 설치하면 된다.
sudo port install git-core +svn 

/opt/local/libexec/git-core/git-svn이 깔린 것을 확인 할 수 있다.
git-svn을 직접 실행해도 되지만 아마 PATH에 없을 것이다. 아래와 같이 git svn의 형태로 실행시키면 된다.
git svn clone [-s] http://url.to.svn.repo/

refs: 
 http://alecthegeek.wordpress.com/2007/09/20/getting-git-svn-working-on-the-mac/
 http://rajshekhar.net/blog/archives/343-git-svn-on-macports.html

happy hackin' 

git merge

tips & tricks 2011. 9. 23. 15:50 by manywaypark
예전에 sqlite의 erlang connector관련해서 github에서 작업한 적이 있었다.
한참 방치하다가 들어가 보니 alexeyr님 및 다른 개발자들이 많이 발전시켜 놓은 상태였다(rebar 적용 등).
내쪽에 merge를 하고 싶었는데 문제는 내가 git에 별로 익숙치 않다는 것... Orz.
검색 및 삽질을 통해 merge하는 데에는 성공했는데, 역시 아직 손에 익지는 않은 듯하다.
일단 성공한 로그를 남겨둔다.
 
$ git clone git@github.com:mwpark/sqlite-erlang.git
$ cd sqlite-erlang
$ git branch # local branches
* master
$ git branch -a # all branches
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/gh-pages
  remotes/origin/master
$ git remote add alexeyr https://github.com/alexeyr/erlang-sqlite3.git
$ git remote -v
alexeyr https://github.com/alexeyr/erlang-sqlite3.git (fetch)
alexeyr https://github.com/alexeyr/erlang-sqlite3.git (push)
origin git@github.com:mwpark/sqlite-erlang.git (fetch)
origin git@github.com:mwpark/sqlite-erlang.git (push)
$ git checkout -b alexeyr/master
Switched to a new branch 'alexeyr/master'
$ git branch -r
  origin/HEAD -> origin/master
  origin/gh-pages
  origin/master
$ git pull alexeyr master:HEAD
$ git checkout master
NOTE: 여기서 conflict 생기면 add/rm 등을 해야함 (처음 checkout 시에 메시지 나오며, git status로 다시 확인 가능).
conflict 해결 후 다시 git checkout master 해서 branch 변경에 성공해야함.
$ git commit -m "merged https://github.com/alexeyr/erlang-sqlite3.git"
......
$ git push
Counting objects: 30, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (24/24), done.
Writing objects: 100% (26/26), 127.78 KiB, done.
Total 26 (delta 2), reused 16 (delta 0)
To git@github.com:mwpark/sqlite-erlang.git
   a2e6238..61e929f  master -> master

refs:
http://gitref.org/branching/#merge
http://markosullivan.ca/how-to-handle-a-pull-request-from-github/
http://www.viget.com/extend/i-have-a-pull-request-on-github-now-what/

happy hackin' 
오류 상황:

git clone https://github.com/KentBeck/junit.git
Cloning into junit...
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/KentBeck/junit.git/info/refs

fatal: HTTP request failed


해결:
환경변수 GIT_SSL_NO_VERIFY를 true로 설정하면 된다.

GIT_SSL_NO_VERIFY=true


refs:

happy hackin'
git diff --no-prefix > patchfile # 패치 생성
cd path/to/top/                  # 이동
patch -p0 < patchfile            # 적용

--no-prefix 옵션 없이 생성된 patch 파일이 있다면,
patch -p1 < patchfile

참고: patching with git diff

happy hackin'
1 2 
분류 전체보기 (306)
잡담 (20)
함수형 언어 (65)
emacs (16)
java (18)
tips & tricks (154)
사랑 (1)
가사 (0)
독서 (4)
mobile (6)
비함수형 언어 (2)

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

05-04 17:08