LoginSignup
0
0

More than 1 year has passed since last update.

【初心者が始める】githubの環境構築(前編)

Last updated at Posted at 2022-04-02

Pythonの勉強を始めました。
『ゼロから作るDeep Learning』にて、githubで公開しているスクリプトを使用するために、今回githubを使い始めました。
githubを使い始める際の手順は下記リンクで行なっています。

上記サイトの手順5 「Githubにプッシュする」で、git initを実行すると下記のようなヒントが表示されました。

hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Initialized empty Git repository in /Users/XXX/Documents/XXX/.git/

このヒントは英語で丁寧に説明されており、詳しく理解はしていませんが、どうやらinitial branchの名前を現在「master」に設定しているが、名前を変更される場合があるため、これからレポジトリを作成する際には名前を変更した方がよい。と言う内容らしい。

そこでわざわざ下記変更方法まで記述してくれている丁寧さ。

git config --global init.defaultBranch <name>

基本的にはinitial branchの名前は「master」の代わりに「main」、「trunk」、「development」などがあるそうだ。
そこで私は下記コマンドで、現在作成したinitial branchの名前を「development」に名前変更しようと思ったのだが、

git config --global init.defaultBranch <development>

そしてら下記のエラーが発生。

sh: parse error near `\n'

どうやら、先ほどinit.defaultBranch <development>とコマンドを打ち込んでいたが、この上記リンクの説明では< >は打ち込まなくて良いらしい。つまり下記が正解。

git config --global init.defaultBranch development

初心者あるある、説明の説明が必要ってやつですね!

残りの環境構築も進めていきます!

下記リンク参考。

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