警告:この問題はgitの使用についてではなく、Linuxでのパイプの使用についてはgit
コマンドの例として示しています。 git push
別のコマンドの出力に与えられた行を実行してください
fatal: The current branch my_branch has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin my_branch
のように出力を有する
私はすなわちgit push --set-upstream origin my_branch
、与えられたコマンドを実行します。
git push 2>&1 | tail -3
を実行すると、git push --set-upstream origin my_branch
が画面に表示されます。
質問:次のパイプに追加するコマンドは、git push
となります。だから私はbash
に自分自身をgit push 2>&1 | tail -3 | command_to_eval_given_string
「tail-3」ではなく「tail-1」が必要です。これはちょうど最後の1行です。 – gilez