LoginSignup
0
0

More than 3 years have passed since last update.

github自分の備忘録

Posted at

GitHubの自分用備忘録

ssh(Secure SHell)の公開鍵と秘密鍵を生成するLinuxコマンド

これで生成した公開鍵をGitHubに登録しておく
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

現在のディレクトリをリポジトリにする

git init

//指定されたディレクトリになる元のリポジトリをコピーする

git clone git@github.com:【ユーザー名】/【リポジトリ名】.git

生成した鍵の場所へ移動して所有者のみの読み書き権限を秘密鍵に与える

cd ~/.ssh
chmod 600 秘密鍵の名前

ssh-agent起動

eval `ssh-agent`

ssh-agentに秘密鍵を登録しておく

ssh-add ~/.ssh/秘密鍵の名前

登録できたか確認

ssh-add -l

githubと疎通出来たか確認

ssh -T git@github.com

指定したファイルやディレクトリをaddする

git add ファイルやフォルダ名

ディレクトリ内にある物をすべてadd

git add --all

現在の状態を確認

git status

commitする

git commit -m "first commit"

masterブランチからpush

git push -u origin master

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