facebook twitter hatena line email

「Git/github」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(githubのwikiに画像を追加)
行47: 行47:
 
==コマンド一覧==
 
==コマンド一覧==
 
http://sourceforge.jp/magazine/09/03/16/0831212
 
http://sourceforge.jp/magazine/09/03/16/0831212
 +
 +
==リリースを作成する==
 +
タグでバージョンを作る
 +
$ git tag -a v.1.0.0
 +
タグ確認
 +
$ git tag
 +
v.1.0.0
 +
タグをgithubへpush
 +
$ git push origin v.1.0.0
 +
# github.com側のreleaseページに移動
 +
# "Draft a new release"ボタンを押す
 +
# 画面のtag versionとtitleに"v.1.0.0"を入力
 +
# 適切な変更点を下の欄に入れる
  
 
==2段認証をonに==
 
==2段認証をonに==

2018年7月11日 (水) 14:32時点における版

セットアップ

  1. git/windowsインストール [ショートカット]をまずやる
  2. githubのアカウントを作成
  3. ssh public keysでkeyにid_ssh.pubのテキストデータを入れる(タイトルは適当に
  4. Git Bashで以下コマンドを実行しconnection~成功と出ればOK
$ ssh git@github.com
  1. ユーザ名、メアド設定
$ git config --global user.name "自分のユーザー名"
$ git config --global user.email "自分のメアド"

リポジトリ作成

  1. 右中の[New repository]ボタンをクリック

初回コミット方法

mkdir hellogithub
cd hellogithub
git init
touch hello.txt
git add hello.txt
git commit -m 'first commit'
git remote add origin git@github.com:[user1]/[project1]
git push -u origin master

フォーク解除

admin/Delete this repository

リポジトリコピーからのコミット(ちょっと違うがsvnでいうチェックアウトなイメージ

git clone git@github.com:[user1]/[project1] [project1]
cd project1
git add hello.txt
git commit -m 'hellodesu'
git push

注:コメントがないと怒られます。

ファイル削除

git delete hello.txt

ファイル2回目以降コミット

git add -u
git commit -m 'adddesu'
git push

ファイル最新に

git pull

コマンド一覧

http://sourceforge.jp/magazine/09/03/16/0831212

リリースを作成する

タグでバージョンを作る

$ git tag -a v.1.0.0

タグ確認

$ git tag
v.1.0.0

タグをgithubへpush

$ git push origin v.1.0.0
  1. github.com側のreleaseページに移動
  2. "Draft a new release"ボタンを押す
  3. 画面のtag versionとtitleに"v.1.0.0"を入力
  4. 適切な変更点を下の欄に入れる

2段認証をonに

  1. githubの管理画面
  2. Account Settings/Set up tow-factor authentication

QRコード認証であれば

  1. Set up using an app

SMS認証であれば

  1. Set up using SMS


Permission denied (publickey).エラーが出る場合

sshの公開鍵がgithubのuserアカウントに登録されているか確認。

Username for 'ttps://github.com':が出る場合

remoteのurlがhttps担っている場合はsshに切り替える

githubのwikiに画像を追加

例:helloworld.gitのwikiに画像を追加したい場合、以下imagesに追加する

$ git clone git@github.com:user1/helloworld.wiki
ls helloworld.wiki/images

参考:http://www.pupha.net/archives/1632/

githubドメイン向けrsaの作り方

$ ssh-keygen -t rsa
~/.ssh/github_id_rsa
$ vi ~/.ssh/config
Host github.com
  HostName github.com
  IdentityFile ~/.ssh/github_id_rsa
  User user1
$ chmod 600 ~/.ssh/config

参考サイト

http://wp.graphact.com/2011/02/07/github-windows-2011/