0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Astro・Git・GitHub 作業中に見るコマンド早見表

0
Posted at

Astro・Git・GitHub 作業中に見るコマンド早見表

Astro・npm

npm run dev # 開発サーバー起動
npm run build # 公開用ファイルを生成
npm run preview # ビルド結果を確認
npm install # 依存パッケージをインストール
node -v # Node.jsのバージョン確認
npm -v # npmのバージョン確認
npx astro --version # Astroのバージョン確認
npm create astro@latest -- --template blog # ブログ用テンプレートから新規作成

Git・日常操作

git status # 変更状況を確認
git diff # 未ステージの変更を確認
git add . # 変更をステージ
git diff --staged # コミット対象を確認
git commit -m "Update blog" # 変更をコミット
git log --oneline # コミット履歴を確認
git rev-parse --show-toplevel # Gitの管理ルートを確認

Git・削除と復元

git add -u # 追跡済みファイルの変更・削除をステージ
git rm ファイル名 # ファイル削除とステージ
git restore ファイル名 # 未ステージの変更・削除を復元
git restore --staged ファイル名 # ステージだけを解除
git restore --source=HEAD~1 -- ファイル名 # 指定ファイルを1つ前のコミットから復元
git revert HEAD # 直前のコミットを打ち消す新規コミットを作成

GitHub・同期と認証

git remote -v # 接続先GitHubリポジトリを確認
git push # コミットをGitHubへ送信
git pull --ff-only # リモートの変更を取得・早送り更新
git push -u origin main # mainブランチを初回送信・追跡設定
git config --show-origin --get-all credential.helper # 認証ヘルパーを確認

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?