新しい環境でGitをいきなり使うときのメモ

スポンサーリンク

設定をしていないので、以下のようなログがでますというのを残しておきます。

gitのアカウントの設定をしていないときのログ

 *** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'root@ip-192-168-4-193.(none)')

表示にあるように、以下のコマンドで、gitアカウントのemail,nameを設定してあげれば良い

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

git push時にブランチ名やタグ名(refspec)を指定しなかったときのログ

warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: The current branch maintenance has no upstream branch.
To push the current branch and set the remote as upstream, use
    git push --set-upstream origin maintenance

参考

git push時に表示されるwarning: push.default is unset...の意味と解決方法

git push時に表示されるwarning: `push.default is unset...`の意味と解決方法 - Qiita
(おそらく)git v1.8から以下のようなメッセージが出るようになった人は多いと思います.この意味を解説します.$ g push warning: push.default is unset; …

checkoutの時にあやまって、sudoでやってしまったりすると、ややこしくなるのでご注意ください。

※コマンドを打っても、エラーも表示されず、一見うまくいったかのようになります。
 初心者の時に理解が足りずやってしまいました。

コメント

タイトルとURLをコピーしました