|
@@ -2,66 +2,18 @@
|
|
|
|
|
|
> Main command for all `git` commands
|
|
|
|
|
|
-- Create a new local repository
|
|
|
+- Check the Git version
|
|
|
|
|
|
-`git init`
|
|
|
+`git --version`
|
|
|
|
|
|
-- Show changed files which are not yet added for commit
|
|
|
+- Call general help
|
|
|
|
|
|
-`git status`
|
|
|
-
|
|
|
-- Show changes to tracked files
|
|
|
-
|
|
|
-`git diff`
|
|
|
-
|
|
|
-- Add all current changes to the next commit
|
|
|
-
|
|
|
-`git add .`
|
|
|
-
|
|
|
-- Commit staged files to the repository with comment
|
|
|
-
|
|
|
-`git commit -am "Commit message"`
|
|
|
-
|
|
|
-- Replace the last commit with currently staged changes
|
|
|
-
|
|
|
-`git commit --amend`
|
|
|
-
|
|
|
-- Show all commits
|
|
|
-
|
|
|
-`git log`
|
|
|
-
|
|
|
-- Clone an existing repository
|
|
|
-
|
|
|
-`git clone {{remote-repository-location}}`
|
|
|
-
|
|
|
-- List all existing branches
|
|
|
-
|
|
|
-`git branch`
|
|
|
-
|
|
|
-- Create new branch based on current branch
|
|
|
-
|
|
|
-`git branch {{new-branch}}`
|
|
|
-
|
|
|
-- Switch to another branch
|
|
|
-
|
|
|
-`git checkout {{another-branch}}`
|
|
|
-
|
|
|
-- Delete a local branch
|
|
|
-
|
|
|
-`git branch -d {{branch-name}}`
|
|
|
-
|
|
|
-- Download repository from remote location and merge with current local branch
|
|
|
-
|
|
|
-`git pull {{remote-repository}} {{local-branch}}`
|
|
|
-
|
|
|
-- Publish local changes on a remote location
|
|
|
-
|
|
|
-`git push {{remote-repository}} {{local-branch}}`
|
|
|
+`git --help`
|
|
|
|
|
|
-- Merge a branch with your current HEAD branch
|
|
|
+- Call help on a command
|
|
|
|
|
|
-`git merge {{branch-name}}`
|
|
|
+`git help {{COMMAND}}`
|
|
|
|
|
|
-- Calling help
|
|
|
+- Execute Git command
|
|
|
|
|
|
-`git --help`
|
|
|
+`git {{COMMAND}}`
|