From 9891588789f1b905cc04e89916f24872c1600400 Mon Sep 17 00:00:00 2001 From: Chirag Date: Sun, 2 Mar 2014 16:41:24 +0530 Subject: [PATCH 1/3] Updating the git page This page might seem slightly big for a project called tl;dr, but git has tons of commonly used options and I've kept all descriptions as short but meaningful as possible (within 80 characters) --- common/git.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/common/git.md b/common/git.md index 84c45dab0..baed8a5b9 100644 --- a/common/git.md +++ b/common/git.md @@ -2,6 +2,78 @@ > Main command for all `git` commands +- Create a new local repository + +`git init` + +- Show changed files which are not yet added for commit + +`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` + +- Show what revision and author last modified each line of a file + +`git blame {{file}}` + +- 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}}` + +- Merge a branch with your current HEAD branch + +`git merge {{branch-name}}` + +- Reset current HEAD to the previous commit and preserve all unstaged changes + +`git reset {{commit}}` + +- Discard all local uncommitted changes + +`git reset --hard HEAD` + - Checking git version `git --version` From 85e5fc87d6ab263b71cb6314ef68b30572aa550b Mon Sep 17 00:00:00 2001 From: Chirag Date: Sun, 2 Mar 2014 16:45:04 +0530 Subject: [PATCH 2/3] Removing unnecessary lines from the git page Since the last change, I don't think we need to include git 'command' or git version --- common/git.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/common/git.md b/common/git.md index baed8a5b9..1faa12816 100644 --- a/common/git.md +++ b/common/git.md @@ -74,14 +74,6 @@ `git reset --hard HEAD` -- Checking git version - -`git --version` - - Calling help -`git --help` - -- Executing git command - -`git {{command}}` \ No newline at end of file +`git --help` \ No newline at end of file From f648192119729f0ca1156bbd5b79c9512720f2e5 Mon Sep 17 00:00:00 2001 From: Chirag Date: Mon, 3 Mar 2014 00:07:39 +0530 Subject: [PATCH 3/3] Removing unnecessary git commands Removing less frequently used git commands: reset and blame to make tldr pages serve their purpose of being short ;) --- common/git.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/common/git.md b/common/git.md index 1faa12816..cd98bf5c1 100644 --- a/common/git.md +++ b/common/git.md @@ -30,10 +30,6 @@ `git log` -- Show what revision and author last modified each line of a file - -`git blame {{file}}` - - Clone an existing repository `git clone {{remote-repository-location}}` @@ -66,14 +62,6 @@ `git merge {{branch-name}}` -- Reset current HEAD to the previous commit and preserve all unstaged changes - -`git reset {{commit}}` - -- Discard all local uncommitted changes - -`git reset --hard HEAD` - - Calling help -`git --help` \ No newline at end of file +`git --help`