git add main.texgit commit -m "Add a line from Git"git push
出力の最後の行に、進んだブランチが表示されます。
53aca61..db007e3 main -> main
変更はエディターに反映され、開いているエディターは自動的に更新されます。新しいファイル、フォルダー、名前の変更はファイルツリーに表示されます。History では、変更に You (via Git) と表示されます。コミットメッセージはそこには表示されません。
プロジェクト履歴の push
Git が push を拒否した場合
その間にプロジェクトが変更されていると、Git は push を拒否します。
! [rejected] main -> main (fetch first)
まずその変更を取得してから、もう一度 push します。
git pull --no-rebase --no-editgit push
単純な git pull は fatal: Need to specify how to reconcile divergent branches. で止まることがあります。上の --no-rebase オプションはこれに対応するもので、両側の変更をマージします。両側で同じ行が変更されていると、pull は CONFLICT (content): Merge conflict in main.tex で止まります。ファイルを修正してから、次を実行します。
git add main.texgit commit -m "Merge the changes from the editor"git push