GitのどのようにTOS :初心者として知っておくべきGitコマンド
7337 ワード
あなたがgitについて聞いたことがあるならば、あなたがそれのコードをカンニングの速い垣間見ることを望むならば、ここで、それはあなたのためです.
ここでは、gitで動作するときに日常的に使用するコマンドを一覧表示します.
現在のユーザ名とメールの変更方法
既存のプロジェクトのクローンの作成方法
レポをクリックして'クローンやダウンロード'をクリックしてコピーしてください
repoをクローンするディレクトリに移動します
4 )別のブランチに切り替える方法
ファイルのステージング状態への追加方法
ステージファイルのコミット方法
7 )変更をRPOにプッシュする方法
8 )変更を一時的に保存してから取得する方法
9 )新しいブランチを作成してリモートにプッシュする方法
注意:別のブランチにチェックアウトしたい枝にある場合は
プロジェクトフォルダのルートに移動
ここでは、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を無視してください、そして、提案はこれをより良いポストにするために歓迎されます.Reference
この問題について(GitのどのようにTOS :初心者として知っておくべきGitコマンド), 我々は、より多くの情報をここで見つけました https://dev.to/ezhurik/how-tos-of-git-git-commands-you-should-know-as-a-beginner-4f9oテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol