반응형

Git Config

  • 설정 목록 확인
    • git confi --list
  • 사용자정보 변경
    • git config  --global user.name "이름"
    • git config --global user.email "이메일@"
  • 비밀번호 재설정
    • git config --global --unset user.password

 

 

Git History

  • 커밋 히스토리가 중요한 이유는?
    • 의미있는 커밋을 만들어서 운영하는데 도움이 되고자 한다.버그가 언제 터졌는지 파악하기 쉽다.레거시 코드를 수정할 때...
  • 히스토리를 깔끔하게 만드는 3가지 머지 전략
    • Create a merge commit
    • Squash and merge
    • Rebase and merge

 

 

Git Rebase 

  • 로그 합치기
    • git rebase -i {원하는커밋로그의 바로 전 로그}
    • 합쳐질 것들을 squash 로 설정하여 저장 후 인터렉티브모드 종료
    • git status 로 수행할 명령어 확인
    • 이전 로그 메시지 수정하기
    • 수정할 것을 edit 로 하고 메시지 수정 후 인터렉티브모드 종료
    • git status 로 수행할 명령어 확인
    • git commit --amend 수행
    • git rebase --continue 수행정상적으로 메시지 수정 완료

 

Git Tag

 

Git Graph

  • git log --graph --oneline
  • git log --oneline --decorate

 

Git Rename - 브랜치 이름 변경하기

  • 다른 브랜치에서 바꾸고 싶은 브랜치 이름 변경하기
    • git branch -m {old-name} {new-name}
  • 현재 브랜치의 이름 바꾸기
    • git branch -m {new-name}

 

Git Reset vs Revert

둘다 되돌리기 이나 Reset은 history는 유지하지 않으나 Revert는 history를 유지한채 수행된다.

  • git reset --soft
    • stage 상태로 되돌린다.
  • git reset --mixed
    • unstaged 상태로 되돌린다.
  • git reset --hard
    • 이전 history를 삭제하고 되돌린다.
  • git revert
    • 바로 전 commit에 대해 revert해야하고 건너뛰어 더 이전의 commit을 revert하면 conflict가 발생한다.

 

Git Force Commit

  • 가장 최근 커밋 내역 되돌리기
    • git reset HEAD^
  • 리모트 강제 푸시
    • git push -f origin {BranchName}

 

Git commit log copy

  • git cherry-pick {commit-log}

 

Git Errors

  • -- fatal: refusing to merge unrelated histories
    • git pull origin {branch} --allow-unrelated-histories

 

Git flow 

 

 

 

반응형
반응형

error: pathspec 'BRANCH-NAME' did not match any file(s) known to git.

git remote update
git fetch 
git checkout --track origin/<BRANCH-NAME>


http://stackoverflow.com/questions/5989592/git-cannot-checkout-branch-error-pathspec-did-not-match-any-files-kn






반응형
반응형

[Git] 원격 저장소와 연결하기.


Gerrit 과 같은 repository 에 공간을 만든 고 로컬에도 저장소를 만든 후 아래와 같은 작업을 통해서 

remote 와 연결? 한다.


git init  후 ....


git remote add origin //your github url

//pull those changes

git pull origin master

//now, push your work to your new repo

git push origin master


완료.!! ^^



반응형
반응형


1. 아래와 같이 먼저 필요한 라이브러리들을 설치한다.



2. 그런 다음에 yum install git 을 실행하면 설치가 되는데 경우에 따라서 에러가 발생할 수 있다.



3. 아래와 같이 처리해 주면!!! ^^ 잘 되더라!!!


4. 그래서- 결론은 complete! installed!


끝--!








반응형

+ Recent posts