Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active January 4, 2016 04:49
Show Gist options
  • Save kjunichi/8570969 to your computer and use it in GitHub Desktop.
Save kjunichi/8570969 to your computer and use it in GitHub Desktop.

httpからgit(ssh)にするには

git push origin master

の度にアカウント入れるのは面倒すぎ!

どうやるか

git remote set-url origin [email protected]:kjunichi/hoge.git

別のマシンからsshでコミットするには

cat ~/.ssh/id_rsa.pub

をGitHubのアカウントページの鍵登録ページにコピー

ただし、Herokuとは別の鍵にしたいとか言い出すと~/.ssh/config書いてその旨記述する必要あり。

Ubutuの俺環境から使うには

ssh-agent bash
ssh-add ~/.ssh/githubの秘密鍵

関連Gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment