IT/programming

git 에서 github 로 보내기 & github 에서 git 으로 가져오기

나령 윤기도 2022. 12. 23.

git 에서 github 로 보내기

syski@syskido MINGW64 ~/OneDrive/바탕 화면/zido_kido
git init
Initialized empty Git repository in C:/Users/syski/OneDrive/바탕 화면/zido_kido/.git/
syski@syskido MINGW64 ~/OneDrive/바탕 화면/zido_kido (master)

 

git status
On branch master
No commits yet
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        index.js
        package.json
nothing added to commit but untracked files present (use "git add" to track)
syski@syskido MINGW64 ~/OneDrive/바탕 화면/zido_kido (master)

 

git remote -v
origin  https://github.com/syskido/zido_kido.git (fetch)
origin  https://github.com/syskido/zido_kido.git (push)
syski@syskido MINGW64 ~/OneDrive/바탕 화면/zido_kido (master)

 

$ git commit -m "테스트 메세지"
[master (root-commit) c7b29f1] 테스트 메세지
 2 files changed, 12 insertions(+)
 create mode 100644 index.js
 create mode 100644 package.json
syski@syskido MINGW64 ~/OneDrive/바탕 화면/zido_kido (master)

 

git push origin master
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 12 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 482 bytes | 241.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/syskido/zido_kido.git
 * [new branch]      master -> master
syski@syskido MINGW64 ~/OneDrive/바탕 화면/zido_kido (master)

 

git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.
syski@syskido MINGW64 ~/OneDrive/바탕 화면/zido_kido (master)

 

 

github 에서 git 으로 가져오기

 

git clone https://github.com/syskido/zido_kido.git
Cloning into 'zido_kido'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 7 (delta 0), reused 4 (delta 0), pack-reused 0
Receiving objects: 100% (7/7), done.

syski@syskido MINGW64 ~/OneDrive/바탕 화면/zido_kido (master)

 

댓글