Cute Happy Ghost
본문 바로가기
etc/git

gitbash에서 visualstudiocode로 이동

by JENN_tech7 2020. 11. 10.
728x90
SMALL

git bash에서 

user1@user1-PC MINGW64 ~
$ git clone https://github.com/Jenn-tech/Frontend
Cloning into 'Frontend'...
warning: You appear to have cloned an empty repository.

user1@user1-PC MINGW64 ~
$ cd Frontend/

user1@user1-PC MINGW64 ~/Frontend (master)
$ code .

user1@user1-PC MINGW64 ~/Frontend (master)
$

 

dㅇ깃클론 저장소복붙- 그 파일로 이동- code .

 

$ ls | grep Frontend 했을 때 잘 나오면 잘된거

상위폴더로 이동 cd ..

 

 

 

 

user1@user1-PC MINGW64 ~
$ cd Frontend

user1@user1-PC MINGW64 ~/Frontend (master)
$ touch README.md

user1@user1-PC MINGW64 ~/Frontend (master)
$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        README.md

nothing added to commit but untracked files present (use "git add" to track)

user1@user1-PC MINGW64 ~/Frontend (master)
$ git add .

user1@user1-PC MINGW64 ~/Frontend (master)
$ git commit -m "kh frontend"
[master (root-commit) 1379f35] kh frontend
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 README.md

다시 git status해주면

user1@user1-PC MINGW64 ~/Frontend (master)
$ git status
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

nothing to commit, working tree clean

nothing to commit어쩌고나오면 됨

 

 

 

 

user1@user1-PC MINGW64 ~/Frontend (master)
$ git branch -M main

쳐주면 master가 main으로 바뀐다

 

user1@user1-PC MINGW64 ~/Frontend (main)
$ git remote -v
origin  https://github.com/Jenn-tech/Frontend (fetch)
origin  https://github.com/Jenn-tech/Frontend (push)

 

user1@user1-PC MINGW64 ~/Frontend (main)
$ git push -u origin main
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 212 bytes | 212.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/Jenn-tech/Frontend
 * [new branch]      main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.

 

 

 

code . 누르면 비주얼스튜디오로 연결됨

728x90
LIST

'etc > git' 카테고리의 다른 글

git_please tell me who you are  (0) 2020.11.11
gitignore  (0) 2020.11.10
git 4단계  (0) 2020.11.09
visual studio code에서 저장소에 올리는법  (0) 2020.11.09
깃헙 계정이 이미 있을 때  (0) 2020.10.27

댓글