railsの開発で、gitlabを使っていて、そこでのgitの使い方がいまいち理解できておらず毎回エラーがでてきてしまうので質問させていただきます。
まず、vagrant使ってローカル環境で開発しており、自分で新しく作ったファイルや変更したファイルのみgit add→ git commitします。そこでgit checkout develop →developにて、git merge 先程作業してたbranch → git commit → git push → git checkout -b 次の作業のbranch → git merge develop → 次の作業
という流れでやろうとしているのですが、上のpushの時に毎回エラーが出てきてしまいます。
! [rejected] HEAD -> develop (fetch first)
上記が毎回でまして、fetchしろという意味だと思うので、git fetch → git merge origin/develop とまたエラーが出ます
error: There was a problem with the editor 'nvim'. Not committing merge; use 'git commit' to complete the merge.
ここでgit statusすると毎回
All conflicts fixed but you are still merging. # (use "git commit" to conclude merge)
とでてきます。またgit commit すると、エディターみたいなのが出てきます。よくわからないのでq!で退出して、今度は git commit -m "" するとcommit通ります。
ここでまたgit push すると上記push時のエラーになりループしています。
このような場合どのように対処したらよいでしょうか?
git の記事は沢山見つかるんですが結局何が原因でどうしたら改善できるのかわかりませんでしたので質問させていただきました。まだgit自体使い始めたばかりなので教えていただけると助かります。よろしくお願いいたしますm(__)m
追記:上記ループ繰り返しているといつのまにかpushできるようになる時があるのですが、上記以外で他のコマンド書いてないと思うので、なぜpushできたのかわかりません。
追記2:git config --show-origin --get all core.editorの反応
error: unknown option `show-origin' usage: git config [options] Config file location --global use global config file --system use system config file --local use repository config file -f, --file <file> use given config file Action --get get value: name [value-regex] --get-all get all values: key [value-regex] --get-regexp get values for regexp: name-regex [value-regex] --replace-all replace all matching variables: name value [value_regex] --add add a new variable: name value --unset remove a variable: name [value-regex] --unset-all remove all matches: name [value-regex] --rename-section rename section: old-name new-name --remove-section remove a section: name -l, --list list all -e, --edit open an editor --get-color <slot> find the color configured: [default] --get-colorbool <slot> find the color setting: [stdout-is-tty] Type --bool value is "true" or "false" --int value is decimal number --bool-or-int value is --bool or --int --path value is a path (file or directory name) Other -z, --null terminate values with NUL byte --includes respect include directives on lookup
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/14 02:52