日記帳
本ページはプロモーションが含まれています
カテゴリー
Links
blog(ブログ)マスター
アンドロイドの巣
ゼロから始めるベランダ菜園
タイトル
ラジコン
2024年5月
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

アーカイブ

2024年04月 のアーカイブ

タイトル

執筆:2024.04.12
編集:2024.04.12




手順

(1) コマンドプロンプトを起動します

(2) 重要: コードページのデフォルトがシフトジスなのでをUTF8に変更します。

(3) git bashを呼び出します。

バッチファイルの場合は、utf8でファイルを保存します。

@rem CODE PAGE UTF-8
chcp 65001

"C:\Program Files\Git\bin\bash.exe" --login -i -c "bash内の実行したいunixコマンド"


用途例

タスク(cron) と組み合わせるとリポジトリの自動更新ができます
バッチファイルに入れておいたほうが、マシンを変更したときや修正したいときに便利です。

1行にするには、 && でつなげます。

最初からフォルダ移動していたほうがいいかもですね.

chcp 65001 && chdir "パス" && "C:\Program Files\Git\bin\bash.exe" --login -i -c "bash内の実行したいunixコマンド"



-c
If the -c option is present, then commands are read from the first non-option argument command_string. If there are arguments after the command_string, the first argument is assigned to $0 and any remaining arguments are assigned to the positional parameters. The assignment to $0 sets the name of the shell, which is used in warning and error messages.


-i 対話的

If the -i option is present, the shell is interactive.

タイトル

執筆:2024.04.08
編集:2024.04.08


forgejo/gitea

アーカイブのルートフォルダ名

デフォルト(規定値): ブランチ名、タグ名


gitコマンドの --prefix に相当する機能ですね
コマンドで圧縮すれば簡単に実現できます。

git archive --prefix=ルートフォルダ名


変更するには、

» 続きを読む



PR

[PR]