kkamagi's story

IT, 정보보안, 포렌식, 일상 공유

Programming

git 저장소 연결(로컬PC에서)

까마기 2020. 8. 7. 10:29
반응형

[github] 저장소 연결 (로컬에서)

 

Quick setup — if you’ve done this kind of thing before

 Set up in Desktop

or

Get started by creating a new file or uploading an existing file. We recommend every repository include a README, LICENSE, and .gitignore.

…or create a new repository on the command line

echo "# python_study" >> README.mdgit init

git add README.md

git commit -m "first commit"

git remote add origin https://github.com/karas639/python_study.git

git push -u origin master

…or push an existing repository from the command line

git remote add origin https://github.com/karas639/python_study.gitgit push -u origin master

…or import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.

 

 

참고 :  https://emflant.tistory.com/123

 

* 추후 계속하여 github 저장소로 push가 필요한 경우 해당 폴더로 이동 및 파일, 폴더 복사 후 아래 명령 실행

# git add 파일, 폴더명

ex) git add 01.\ 파이썬\ 기초\(딥러닝\ 및\ 인공지능\ 부록\)/

# git commit -m "메모"

# git push -u origin master

 

 

※ 새 폴더를 만들어서 하거나, github에서 소스를 받아 압축을 풀고 git 저장소와 연결하려는 경우, git 초기화를 해야 한다. (기존에 .git 을 삭제한 경우에도 동일)

 

해당 경로에서 git 초기화를 진행.

# git init

또는

> git init

 

* 초기화되지 않았거나 .git 이 없을 경우 아래와 같이 에러메세지가 발생한다.

반응형