'GIT'에 해당되는 글 20건

  1. 2016.09.30 [Git] 리모트 브랜치 목록 새로고침.
  2. 2016.08.16 [GIT] master 브랜치를 무식하게 변경해 보자.
  3. 2016.04.06 [Git] git fetch --tags
  4. 2016.03.24 [GIT] Git force pull branch to local.
  5. 2015.11.03 [git] remote branch 삭제
  6. 2015.08.25 [git] git 대충 사용하기.
  7. 2015.04.02 [GIT] master branch resync.
  8. 2013.01.22 gerrit 링크
  9. 2012.04.23 git 사내 협업도구 구성.
  10. 2012.04.20 git 구성하기.

[Git] 리모트 브랜치 목록 새로고침.

ITWeb/개발일반 2016. 9. 30. 18:06

ide를 사용하다 보면 git remote branch 목록 sync 가 안될 때가 있습니다.

그래서 수동으로 명령어 날려 주는데요.

혹시 몰라 그냥 기록해 봅니다.



$ git remote prune origin --dry-run


dry run 해보시고 최종 실행 시에는 빼고 돌리시면 됩니다.

:

[GIT] master 브랜치를 무식하게 변경해 보자.

ITWeb/개발일반 2016. 8. 16. 16:22

구글링 하면 많이 나옵니다.

이도 저도 귀찮을 때 사용하세요.


$ git checkout master 

$ git reset --hard better_branch  

$ git push -f origin master 


또는 


$ git branch -M branch_name master


:

[Git] git fetch --tags

ITWeb/개발일반 2016. 4. 6. 17:05

참 별거 아닌데 이런것도 기록을 하고 있습니다. ㅡ.ㅡ;


remote tag 소스를 보려고 하다 intellij 에서 tag 명 넣었더니 못찾아서 땡기 왔습니다.


$ git fetch --tags


:

[GIT] Git force pull branch to local.

ITWeb/개발일반 2016. 3. 24. 14:12

그냥 기억을 돕기 위해 기록해 봅니다.


$ git fetch --all

$ git reset --hard origin/master

$ git pull origin master


:

[git] remote branch 삭제

ITWeb/개발일반 2015. 11. 3. 18:03

git remote branch 삭제 명령어.

(맨날 까먹음.)


[로컬 브랜치 삭제]

$ git branch -d 브랜치명


[리모트 브랜치 삭제]

$ git push origin :브랜치명


:

[git] git 대충 사용하기.

ITWeb/개발일반 2015. 8. 25. 17:02

git 대충 급할 때 대충 사용하기 위한 command


[git 처음 등록]

로컬 저장소 또는 생성한 프로젝트 위치에서 실행 합니다.

예) project-example

$ cd git/project-example

$ git init

$ git add *

$ git commit

$ git remote add origin “github 에 생성한 경로”

$ git push origin master


[파일 수정 후 반영]

$ git add 는 신규 파일인 경우 add 후 commit 수행

$ git commit 은 이미 등록된 파일에 대해서 수정이 완료 된 후 반영 하기 위해 수행

$ git push origin +master 이미 등록된 master를 로컬에 있는 것으로 덮었쓸 때


[원격 브랜치 체크아웃]

$ git checkout -t origin/브랜치명

또는

$ git checkout 로컬브랜치명 원격브랜치명

:

[GIT] master branch resync.

ITWeb/개발일반 2015. 4. 2. 11:09

asf의 master branch를 개인 github master branch로 sync 작업을 하기 위해 아래 명령어를 통해 syncing 작업을 하도록 합니다.

그냥 개인적으로 명령어 기억을 잘 못해서 기록해 봅니다.


$ git branch master

$ git clean -d -f

$ git fetch asf master

$ git push origin +master

:

gerrit 링크

ITWeb/개발일반 2013. 1. 22. 16:23
:

git 사내 협업도구 구성.

ITWeb/서버관리 2012. 4. 23. 19:16

보안 이슈로 인해 사내 소스코드를 github 에 public 하게 못 올리다보니.. private 구성을 해봤습니다.
다들 잘 아시는 내용이라.. 저는 그냥 제가 공부하는 차원에서 remind 합니다.


모두 우분투 환경입니다. ^^*


[필요서버]

master 로 사용할 서버 한 대. (192.168.1.1)

local 개발서버 한 대. (192.168.1.2)

[git install]
이전 글 : http://jjeong.tistory.com/650

sudo apt-get install git git-gui git-doc

[git repository]

mkdir git-test (or test.git, 저장소 생성 할때 나름 만들어진 name rule 같내요)

cd git-test

git init

(or git init --bare, 이건 아래 나오겠지만 git push 했을 때 deny 오류가 나지 않도록 하기 위함 입니다. 저는 실제 이렇게 하지는 않았구요, .git/config 를 수정했습니다.)

vi helloworld.txt // 아무 텍스트나 작성해 보시고 저장 후 나오세요.

git add helloworld.txt

git commit -m "init helloworld.txt"

[git clone]
ssh 를 이용해서 clone 작업했습니다.
svn 의 checkout 과 같다고 보시면 됩니다.

[local 개발서버]

git clone jjeong@192.168.1.1:/home/jjeong/git-test

vi helloworld.txt // checkout 텍스트를 삽입 하고 나오세요.

git commit -m "clone text add checkout"

git push

[error detection]

remote: error: refusing to update checked out branch: refs/heads/master

remote: error: By default, updating the current branch in a non-bare repository

remote: error: is denied, because it will make the index and work tree inconsistent

remote: error: with what you pushed, and will require 'git reset --hard' to match

remote: error: the work tree to HEAD.

remote: error: 

remote: error: You can set 'receive.denyCurrentBranch' configuration variable to

remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into

remote: error: its current branch; however, this is not recommended unless you

remote: error: arranged to update its work tree to match what you pushed in some

remote: error: other way.

remote: error: 

remote: error: To squelch this message and still keep the default behaviour, set

remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.

이런 에러 발생 시 아래 master 서버에 코드 추가

[master 서버]

vi git-test/.git/config
아래 코드 추가 합니다.

[receive]

    denyCurrentBranch = false


[local 개발서버]

git push 

[git master 반영]
이 부분에서 제가 local 에서 push 한 후 master 쪽 파일 업데이트가 잘 되었는지 확인하는 command 를 몰라서
걍 강제로 적용했구요..ㅡ.ㅡ;;
git log 확인 후 git resert --hard 마지막COMMIT.HASHCODE
다른 방법으로는.. 걍 clone 을 한번 더 떠봤습니다.

git clone jjeong@192.168.1.1:/home/jjeong/git-test git-clone
이렇게 하신 후 git-clone 에 들어 가서 바로 직전에 commit 하고 push 한게 잘 반영 되었는지 확인 하면 되겠습니다.

[master 업데이트 된거 반영]

[local 개발서버]

git pull // 하시면 master 꺼로 업데이트 합니다. (pull 은.. merge 가 아닙니다. 그냥 덮어씁니다.)

[branch & merge]
전 그냥 local 개발서버에서 branch 생성하고 걍.. 거기서 merge 까지 테스트 했습니다.

[local 개발서버]

git branch git-branch

git checkout git-branch

vi helloworld.txt // 그냥 수정해 보세요.

git add helloworld.txt

git commit helloworld.txt -m "오타 내기"

git checkout origin/master

git merge git-branch

기타 git 매뉴얼은 git 사이트에서 참고 하시면 됩니다.

:

git 구성하기.

ITWeb/서버관리 2012. 4. 20. 16:49

코드머지 어쩌구 땜시.. git 까지 왔내요.. ^^;

구성, 설치 등등 모든 정보는 사이트에 잘 나와 있습니다.

처음 하시는 분은 beginner 참고 하시면 될 것 같구요.

추천할만한 사이트 링크 공유 합니다.

git 는 설치하게 되면 내가 repository 다. 라고 합니다.
위에 slideshare 문서 보시면.. 그렇다고 하지요.. ^^
만약 사내에서 git 를 이용해서 개발자간 프로젝트를 수행해야 한다면 github.com 과 같은 역할을 하는 서버 하나 구성하고 git 올리고 그넘한테서 clone 받아 push, pull 하면 사내용 github 를 구성할 수 있는게 아닌가 싶내요.

(git clone git@HostName:repository/Project)

뭐, 오늘은 걍.. 우분투에 git 설치 하고 repository 생성하고 파일 올리고 수정하고 등등만 해봤으니, 담주에 위에 이야기 한거 함 해봐야 겠내요.

: