배워서? 남줘라!
[Github] #5 VS Code to github 본문

* VS Code에서 (python) 파일 생성하고, github에 업로드하기
1. Visual Studio Code (VS Code) 다운로드 (https://code.visualstudio.com/)
2. VS Code에서 python 설치
3. [File]→ [open folder]로 원하는 디렉토리 지정. Ex) /c/practice
4. 현재(C://practice) 디렉토리에서 New Folder 클릭하면 하위 디렉토리 만들 수 있다. Ex) c/practice/Project A
5. 현재(c/practice/Project A) 디렉토리에서 New File 클릭하면 그 위치에서 새로운 파일 생성할 수 있다. 파일이름.확장자 입력. Ex) ProjectA1.py
6. 해당 파일에 간단한 코드 입력 → 파일 저장 (Ctrl +S)
7. Staging 하기 (Source control 아이콘 클릭 → initialize repository 하면 tracked됨)
8. Commit 하기 (V 표시 클릭 → commit message 입력)
9. [Terminal] → [New terminal]로 터미널 켜고,
터미널 창에 $ git remote add origin https://github.com/xxx.git 입력
(이 링크는 github에서 xxx 라는 repository 생성하면 나오는 HTTPS 링크 copy and paste 하면 된다.)
10. $ git remote –v 입력하면 사전에 생성한 github의 repository주소 확인 가능. (fetch), (push)등이 나오면 잘 연결된 것이다.
11. $ git push origin master 입력하고 github 해당 repository에서 새로고침 누르면 Project A라는 폴더가 생성되어 있다. 그 폴더 내에 ProjectA1.py 라는 파일도 생성되어 있다.

'Github' 카테고리의 다른 글
| [Github] #6 Colab to github (0) | 2022.07.13 |
|---|---|
| [Github] #4 Local to Remote repository (Push & Pull) (0) | 2022.07.13 |
| [Github] #3 Basic ‘Git’ commands (0) | 2022.07.13 |
| [Github] #2 Basic ‘Linux’ commands (0) | 2022.07.13 |
| [Github] #1 Let’s ‘Git’! (0) | 2022.07.13 |