LoginSignup
0
0

More than 5 years have passed since last update.

Git 導入までの流れ

Posted at

導入までの流れ(for Mac)

1, git のユーザー情報を設定するため、下記コマンドをターミナルに打ち込む

git config --global user.name “[user_name]"
git config --global user.email “[user_email]"

2, git管理したいディレクトリを作成し、テストでadd,commit,pushしてみる。

$ mkdir testproject
$ cd testproject
$ git init
$ echo "git test" > readme
$ git add .
$ git commit -m "first commit"
$ git remote add origin git@github.com:[user_name]/test.git
$ git push origin master

↓こんなエラーが出た時は ssh key を作成する(下記参考サイトを参照)
Error: Permission denied (publickey)

$ cd ~/.ssh
$ ssh-keygen -t rsa -C “[user_email]"

※ password聞かれるからそこは任意のパスを入れる。

3, id_rsa.pubをコピーしてgitに登録する
$ pbcopy < ~/.ssh/id_rsa.pub

ssh key の設定画面にペーストする

これでpushできるようになるはず。

【参考サイト】
・push時にBad owner or permissions と表示された。
http://qiita.com/satomyumi/items/837810ef6176b3b6f4cc
http://kik.xii.jp/archives/179

・gitの使い方を知りたい
http://qiita.com/syougun360/items/013229aeddec08121474
http://www.yoheim.net/blog.php?q=20140104

・公開鍵と秘密鍵 -作成方法
https://joppot.info/2014/07/13/1722

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0