Hsüan's Blog

2015-07-20

使用多重帳號 git push 至 github

git init
git add .

# check files
git status

# set user (用 repo 內的設定覆蓋掉全局的)
git config --global user.name "up9cloud"

# 防止洩漏自己的 email,所以要其他的。而 github 統計必須要使用他規定的 noreply email
git config --global user.email "[email protected]"

# check config
git config --global -l

git commit -m "first commit"

# refer to fixed-host up9cloud.github.com
git remote set-url origin [email protected]:up9cloud/<project-name>.git

git push -u origin master

© 2019 ~ 2024 Hsüan, Powered by Gatsby, Theme Material UI