GitのどのようにTOS :初心者として知っておくべきGitコマンド


あなたがgitについて聞いたことがあるならば、あなたがそれのコードをカンニングの速い垣間見ることを望むならば、ここで、それはあなたのためです.
ここでは、gitで動作するときに日常的に使用するコマンドを一覧表示します.
現在のユーザ名とメールの変更方法
git config --global user.name [Your username]
git config --global user.email [Your email]
詳細については
既存のプロジェクトのクローンの作成方法
レポをクリックして'クローンやダウンロード'をクリックしてコピーしてください

repoをクローンするディレクトリに移動します
git init // Create an empty Git repository or reinitialize an existing one

git clone 'https://github.com/gitrepo/repo.git' //Clone a repository into a new directory
3 )すべてのブランチの一覧表示方法
git branch  // list all branches of the local repo. Branch with asterisk denotes current branch

git branch -a // list all branches of the local and remote repo
詳細については
4 )別のブランチに切り替える方法
git checkout [branch name]  //switches to the desired branch of your repository
詳細情報については
ファイルのステージング状態への追加方法
git add .  //adds all changed files to the staging state

git add [file 1] [ file 2] ... [file n] //adds multiple files to staging
詳細な情報については
ステージファイルのコミット方法
git commit -m [commit message] 
詳細情報については
7 )変更をRPOにプッシュする方法
git push
詳細情報については
8 )変更を一時的に保存してから取得する方法
git stash // all uncommitted local changes have been saved 

git stash pop // The "pop" flag will reapply the last saved state
詳細情報については:git隠し-ヘルプ
9 )新しいブランチを作成してリモートにプッシュする方法
git checkout master // checkout to the master branch

git pull // pulls the latest change from the master if any

git checkout -b [branch name] // creates a branch locally

git push -u origin [branch name] // pushes the branch to remote 
ローカルブランチの削除方法
注意:別のブランチにチェックアウトしたい枝にある場合は
git branch -d [branch name] // deleted branch locally

git push origin --delete [branch name] deletes the branch of remote
11 )ローカルとリモートの分岐の変更方法
git branch -m [old-name] [new-name] // renames branch locally

git push origin: [old-name] [new-name] // renames the branch of remote
12 )ローカルプロジェクトをリモートにアップロードする方法
プロジェクトフォルダのルートに移動
git init

git add .

git commit -m "commit message"

git remote add origin [url]

git push -u origin master
すべてのtypoを無視してください、そして、提案はこれをより良いポストにするために歓迎されます.