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?

More than 1 year has passed since last update.

git command

Last updated at Posted at 2020-01-18

ファイルを作って
mkdir

リポジトリを作って
git init

リポジトリをURLと紐づけて
git remote add origin

コミットして
git commit -m "message"

プッシュすると
git push origin master

git最新版を作業ブランチにマージ
git checkout master
git pull origin master
git checkout test
git merge master
git push origin test

特定ファイルのみマージ
git checkout <ブランチ名> -- <ファイル名>

git add 取り消し
git reset HEAD

git commit 取り消し
git reset --soft HEAD^

リモートから最新版をローカルにpullする
git pull origin master

*使用注意*
push削除
// 直前のコミットを取り消す
git reset --hard HEAD^
// 強制的にPushする
git push -f origin master

ブランチ削除
リモート
git push origin --delete fix/authentication

ローカル
git branch -d fix/authentication

ブランチ一覧同期
git fetch -p

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?