The Beautiful Future

git command 본문

스킬

git command

Small Octopus 2017. 11. 10. 18:25

## 참고 싸이트

-왕초보 깃

https://nolboo.kim/blog/2013/10/06/github-for-beginner/

- 명령어 총정리

https://blog.outsider.ne.kr/572 


### Git 설치

$sudo apt-get install git-core


### 환경설정

$git config --global --list

$git config --global user.name "xxxx"

$git config --global user.email "xxxx@naver.com"

$git config --global color.ui "auto"


### 원리

** project file -> stage -> commit 

** .gitignore file : 관리 안할 파일 리스트

** HEAD는 현재 브랜치의 가장 최신커밋

** 원격저장소 = origin


##원격저장소

$git clone https://github.com/xxx /home/user/project

$git fetch

$git pull

$git push

$git remote add name https://github.com/xxxx

$git remote // list

$git remote show name

$git remote rm name


###명령어

$git --version

$git init

$git add file_name -i -p   // ->stage

$git commit -m "commit message"

$git commit -C HEAD -a --amend

$git status

$git diff --cached // storage <-> stage

$git diff HEAD // storage <-> stage <-> tree

$git mv file_name new_file_name

$git checkout -- file_name

$git branch -r

$git branch branch_a branch_b


# 새로운 브랜치 만들기

http://kyubot.tistory.com/

$git checkout -b newbranch

$git status

$git config --global user.email "abc@gmail.com"

$git commit -m "Add newbranch"

$git remote add newbranch "url"

$git push -u origin newbranch


## 윈도우즈 로그인 문제

암호를 윈도우즈 크래덴셜 매니저가 저장을 하고 있어서 

깃허브 암호 변경시 재설정을 해줘야한다.

커맨트라인에서  rundll32.exe keymgr.dll,KRShowKeyMgr를 

입력 후 암호 재설정한면 된다. 

암호변경 하지 말고 지워 버리면 아톰 같은 툴 쓸때 다시 물어보는데 그때 입력한면 된다.


## 소스트리 인 경우 개짜증난다 시발... 또 로그인이 안된다... 

찾아보니 아래 링크가 그나마 가장 적합해보인다.. 

https://community.atlassian.com/t5/Sourcetree-questions/Git-Credential-Manager-for-Windows-Popups/qaq-p/579905


(1) Installed Git Credential Manager for Windows.

(2) Opened the terminal by clicking the Terminal button in SourceTree.

(3) Issued the commands below:

  • git config --global credential.helper manager
  • git config --global credential.useHttpPath true

The first command set the credential helper to use Git Credential Manager for Windows.

The second command was necessary for me because I use repositories that are on the same server/domain but each repository has different credentials.

모든 local git repository에 credential 정보 저장 다시 안물어보게 하기

git config credential.helper store --global


# 다른 견해

Tools > Options > Authentication


## 퍼미션 디나인 문제 ssh key

https://zeddios.tistory.com/120


'스킬' 카테고리의 다른 글

LAPACK 설치 windows  (0) 2019.04.04
ubuntu remote connection  (0) 2018.01.23
Install Atom editor and integration with Github  (0) 2017.11.10
우분투 명령어  (0) 2017.08.09
caffe locally connected layer  (0) 2016.09.17
Comments