Create a repository
From scratch – create a new local repository
|
|
Download form an existing repository
|
|
Observe your repository
List new or modified files not yet committed
|
|
Show the changes to files not yet staged
|
|
Show the changes to staged files
|
|
Show all staged and unstaged file changes
|
|
Show the changes between two commit ids
|
|
List the change dates and authors for a file
|
|
Show the file changes for a commit id and/or file
|
|
Show full change history
|
|
show change history for file/directory including diffs
|
|
Working with branches
List all local branches
|
|
List all branches, local and remote
|
|
Switch to a branch, and update working directory
|
|
Create a new branch called new_branch
|
|
Delete the branch called my_branch
|
|
Merge branch_a into branch_b
|
|
Tag the current commit
|
|
Make a change
Stage the file, ready for commit
|
|
Stage all changed files, ready for commit
|
|
Commit all staged files to versioned history
|
|
Commit all your tracked files to versioned history
|
|
Unstages file, keeping the file changes
|
|
Revert everything to the last commit
|
|
Synchronize
Get the latest changes from origin (no merge)
|
|
Fetch the latest changes from origin and merge
|
|
Fetch the latest changes from origin and rebase
|
|
Push local chages to the origin
|
|
Finally
When in doubt, use git help
|
|
Or visit https://training.github.com/ for official GitHub training.
参考:
Git Commands and Best Practices Cheat Sheet,Simon Maple
近期评论