miscellaneous
Setting zsh as default terminal in SSH remote linux vscode terminal
Add
{
"terminal.integrated.defaultProfile.linux": "zsh",
}
to Preferences: Open Remote Settings (SSH: hotcake)
using cmd + shift + p
If vscode doesn’t recognize zsh
, install it first.
git branch output issue
git config --global pager.branch false
jupyter notebook, permission denied, docker
Clone a repo from someone else’s Github and push it to a repo on my Github
-
git remote add origin <remote repo address>
: origin이란 이름의<remote repo address>
나타내는 remote을 새로 만듬
error: remote origin already exists
: git clone 하면 remote이름이 default로 origin이라서 이미 있는듯 -
git remote -v
origin <...> (fetch)
origin <...> (push)
-
git remote rename origin upstream
: 기존의 origin을 upstream으로 이름 바꿈 -
git remote add origin <repo on github>
: 여기의 origin은 github에서 새로만든 repo를 나타냄<repo on github>
은 내 github에서 new repo 만든거
(위 두 단계 기존의 origin을 upstream 으로 바꾸고 다시 새로운 origin을 내 new repo on my Github으로 바꾸는 거임.
이 방법 대신에
git remote set-url orign <repo on my Github>
을 써서 upstream을 만드는 대신에 origin이 가리키고 있는 remote repo 주소를 바꿈)
$ git remote
origin
upstream
-
git checkout -b origin
: create a branch “origin” (branch “main”은 이미 있던듯)
따라서 현재 local repo에 branch가 “origin”, “main” 두 개
$ git branch
main
* origin
git checkout main
$ git branch
* main
origin
Note. Your branch is up to date with 'origin/main'
: 여기서 ‘origin/main’은 remote tracking branch 인데
결국 orignal denotes remote name and master denote the remote branch it is tracking.
git checkout -b <branch_name>
vs git branch <branch_name>
git checkout -b <branch_name>
: creates a new branch and checks out (switch to) the new branch git branch <branch_name>
: creates a new branch but leaves you on the same branch git checkout <branch_name>
: check out (switches to) a new branch (copy from remote)
Note that if you were on master branch and run git branch new_branch, both master and new_branch now point to the same commit.
There are more: git switch -c new_branch
, git switch
, etc
Enjoy Reading This Article?
Here are some more articles you might like to read next: