ユーザ用ツール

サイト用ツール


サイドバー

git:コマンド

以前のリビジョンの文書です


よく使うコマンド

gitリポジトリを作成する

> git init

checkout

> git checkout [ブランチ名]

> git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

変更を破棄する

git checkout .

orignのURLを確認する

>git remote -v
origin  https://github.com/nekotype/native-background-timer.git (fetch)
origin  https://github.com/nekotype/native-background-timer.git (push)

>git config --get remote.origin.url
https://github.com/nekotype/native-background-timer.git

orignに手動でpushする

git push -u origin master

特定のコミットに戻す

git logでコミットidを調べて
git reset --hard [コミットid]

現在のブランチ名

> git rev-parse --abbrev-ref HEAD

ブランチを切り替える

> git checkout master

ブランチを作る

//ブランチを作る
git branch [new branch]

//コミットからブランチを作る
git branch [new branch] [commmit]

//ブランチを作って切り替える
git checkout -b [new branch]

コミットメッセージを修正する

git commit --amend -m "fugafuga"
git/コマンド.1556585626.txt.gz · 最終更新: 2019/04/30 09:53 by ips