ラベル github の投稿を表示しています。 すべての投稿を表示
ラベル github の投稿を表示しています。 すべての投稿を表示

2018年3月21日水曜日

ubuntu上でgithubしてみる

github.comでリポジトリを作って,リポジトリをubuntu上にcloneして新しいディレクトリをpushするという流れ.

gitのインストール
$ sudo apt-get install git

githubのユーザ名・アドレスを設定
$ git config --global user.name "username"
$ git config --global user.email user@email.com

sshの公開鍵
$ ssh-keygen -t rsa -C "user@email.com"
return returnでパスワード設定
~/.ssh/id_rsa.pubに公開鍵ができる.中身をまるっとコピーしてブラウザからgithub.comでsetting>SSH and GPG keys,[New SSH key]でペースト.

次に予め作ってあったリポジトリをclone
$ git clone https://github.com/Organization/Repository 
現在のディレクトリにRepositoryがクローンされる.

$ cp -r made-dir Repository
$ cd Repository
$ git add made-dir
$ git commit -m 'any comment'
$ git push

これでgithub上にディレクトリを追加完了.

2017年6月13日火曜日

学内(社内)ネットワークからgitできない

githubからsubmoduleでcloneするときにconnectionがないと怒られる.

fatal: unable to connect to github.com:

原因は学内ネットワークのファイアウォールが強すぎるから

git://~

を弾いてしまっている.ということで「git://」を「https://」に書き換える.

git config --global url."https://".insteadOf git://