![Jenkins用のGitHubを用意する!](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/11/github_for_jenkins.png)
Jenkinsの設定項目にもあったように、やはりリポジトリと連携した方がいいのでは、、という気がしたので、今更ながらGithubの設定手順をまとめました。
最低限コミットするまでまとめているので、備忘録的に。
GitHubでアカウントを作成する
https://github.com/ にアクセスしてアカウントを作成します。
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/10/git_hub_001.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/10/git_hub_002.png)
あとは画面に沿って入力。。。
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/10/git_hub_003.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/10/git_hub_004.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/10/git_hub_005.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/10/git_hub_006.png)
GitBashでローカル環境をセットアップする
ローカル環境にGitHub上のファイル操作を行うための準備をしていきます。
ローカル環境のOSはWindows10、必要なgitのインストーラーは「https://gitforwindows.org/」からダウンロードします。
インストーラーを起動すると、たびたび選択肢が出てきますがデフォルト設定でOK。
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_001-2.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_002-2.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_003-1.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_004-1.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_005-1.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_006-1.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_007.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_008.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_009.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_010.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_011.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_012.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_013.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_014.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_015.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_016.png)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/09/git_bash_017.png)
インストール始まるまで長すぎ。。。
Githubに確認用のリポジトリを作成する
「Create repository」ボタンをクリック
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/11/git_nub_setting_001.png)
適当な名前をつける(とりあえず”jenkins”にしています)
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/11/git_nub_setting_002.png)
リポジトリ完成!
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/11/git_nub_setting_003-3.png)
※コマンド群はGitのコンソールで実行するのでメモしておく
ローカル環境からファイルをコミットする
適当なフォルダを用意してGitのコンソールを立ち上げます。
下記はとりあえずデスクトップにフォルダを新規に作成し、その中で右クリックしています。
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/11/git_nub_setting_004.png)
コンソールが表示されたらメモったコマンドを順番に実行するだけでOK
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/11/git_nub_setting_005.png)
実行するとREADME.mdがGithub側にアップされてることが確認可能
![](http://holiday-programmer.net/wordpress/wp-content/uploads/2022/11/git_nub_setting_007.png)
まとめ
おかしいなぁ、、、
この記事書き始めたのが9月ぐらいなのに、
記事を投稿できたのが11月なのはおかしいなぁ。。。
なんで年末に向けてこうも忙しくなるのか、とりあえずGitを使えるようになれば、幅が広がるか・・・?