Note/coding

[NOTE : coding] git remote branch 가져오기

jir4vvit 2022. 5. 21. 17:23

맨날 구글링해서 정리함

 

 

git remote update

git checkout -t origin/testt

 

 

PS C:\Users\jir4vvit\Desktop\test> git remote update
Fetching origin
remote: Counting objects: 100% (71/71), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 98 (delta 43), reused 58 (delta 41), pack-reused 27
Unpacking objects: 100% (98/98), 149.68 KiB | 1.18 MiB/s, done.
From https://github.com/[repo]
 + 111 chat       -> origin/chat  (forced update)
   222 refactor   -> origin/refactor
 * [new branch]      testt        -> origin/testt
PS C:\Users\jir4vvit\Desktop\test> git checkout -t origin/testt
error: Your local changes to the following files would be overwritten by checkout:
        package-lock.json
        package.json
Please commit your changes or stash them before you switch branches.
Aborting
PS C:\Users\jir4vvit\Desktop\test> git checkout -t origin/testt -f
Switched to a new branch 'testt'
Branch 'testt' set up to track remote branch 'testt' from 'origin'.
PS C:\Users\jir4vvit\Desktop\test> git branch
  chat
  image_upload
  jwt
  main
  point
  refactor
* testt
PS C:\Users\jir4vvit\Desktop\test>