Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Archives
Today
Total
관리 메뉴

A.I

Git 시작하기 본문

UBuntu

Git 시작하기

볼링치는 AI개발자 2021. 1. 8. 16:04

로컬의 Git에 GitHub의 계정 정보 등록하기

$ git config --global user.email "[my-email@gmail.com](mailto:my-email@gmail.com)"

$ git config --global user.name "my-username"  

Git config 정보 알아보기

$ git config -l  

내 컴퓨터에 로컬 저장소 만들기

$ cd ~  
$ mkdir workplace  

Git으로 버전 관리 시작하기

$ cd workplace  
$ git init  

ReadMe 파일생성하기

$ echo "# first-repository" >> README.md  
\--> 파일 안에 first-repository라고 내용이 있는 파일을 생성하겠다는 뜻

$ cat README.md  
\--> 파일 내용을 출력

$ git status --> 상태확인

로컬->인덱스

$ git add README.md  
$ git commit -m “new readme file”  

내 로컬저장소와 원격저장소 연결

$ cd ~/workplace  
$ git remote add origin [https://github.com/xxx/first-repository.git](https://github.com/xxx/first-repository.git)  
\--> origin은 변경 가능  

로컬 저장소에서 원격으로 push

$ git push origin master  

원격저장소에서 복사하여 로컬로 가져오기(다른 폴더에서 사용하기도 가능)

$ git clone [https://github.com/xxx/first-repository.git](https://github.com/xxx/first-repository.git)  

기존 로컬저장소로 원격 저장소내용 가져오기

$ git pull origin master  

'UBuntu' 카테고리의 다른 글

apt-get 명령어 사용법  (0) 2021.01.04
Command Line 기본  (0) 2021.01.04