LoginSignup
1
0

More than 3 years have passed since last update.

GitHub備忘録

Last updated at Posted at 2020-09-09

はじめに

・この記事はGitHubの備忘録です
・対象読者:自身・ある程度Gitの操作を知っている方向き(雑に書いているため)

GitHubの基本操作

  1. GitHubに登録(対応メールアドレスでID・PWを取得)
  2. Profile画面からRepositoriesを選択
  3. 右上のNewを押下してRepositoryを作成
  4. 最初はReadMeもこの時チェックボックスで追加してしまう良い
  5. リンクをコピーしてgit clone <リンク>

GitHub:ローカル to リモートリポジトリの操作

git add <対象ファイル>
git commit -m 'comment'
git push origin master
or
git push origin feature/XX

GitHubにpushしたいのにproxyが超えられない場合の対処法

$git config --global http.proxy http://xxx.com:8080
$git config --global https.proxy http://xxx.com:8080
でgit_configファイルに書き込みを行う。
https:が必要かはproxyの設定に依存する。

GitConfigの設定をリセットしたい場合

$git config --unset http.proxy 
$git config --unset https.proxy

GitConfigの設定を一時的に退避したい場合

anothergitconfigというファイルを作る
$touch ~/.anothergitconfig
Alias設定を行う (Alias設定は短縮呪文みたいなもん)
$alias disableconfig='mv ~/.gitconfig ~/.anothergitconfig'
$alias enableconfig='mv ~/.anothergitconfig ~/.gitconfig'

config設定を外して使いたい場合は、
$disableconfig
その後、git add, git commit, git pushすれば良い

設定したaliasを外したい場合

unalias diableconfigなど

1
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
1
0