8/23-学習ログ-git

■Git

ソースコードをローカル管理する限界に到達したので、gitを導入する。
しかし、触れるのが一年半ぶりなので操作ガチで忘れたので、
思い出しながらやる。




参考サイト
git init

vi pushtest.txt

git add pushtest.txt
git commit -m "コミット確認"
[エラー]
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: empty ident name (for <ono@DESKTOP-RBPIP9E.localdomain>) not allowed
[登録]
ono@DESKTOP-RBPIP9E:~/work/msbeta$ git config user.email "yasuh40205@gmail.com"
ono@DESKTOP-RBPIP9E:~/work/msbeta$ git config user.name "yasutakaono2"
ono@DESKTOP-RBPIP9E:~/work/msbeta$ git commit -m "pushコマンドの確認"
[master (root-commit) 1f7d1e7] pushコマンドの確認
 1 file changed, 1 insertion(+)
 create mode 100644 pushtest.txt
➡通った。

git remote add origin https://github.com/yasutakaono2/msbeta.git
801errorがでた
対処
git fetch

エラー出た
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/yasutakaono2/msbeta.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git pushがreject(拒否)されたときの対処法
 git config pull.rebase false
git push -f origin master

Next Post Previous Post
No Comment
Add Comment
comment url