From 948f5b42aaaa735ca0350451dff071273e01c2ab Mon Sep 17 00:00:00 2001
From: Justin Richardsson <hallaathrad@gmail.com>
Date: Sun, 6 Mar 2016 10:45:44 -0500
Subject: [PATCH] hallaathradisation

---
 Clone-A-Specific-Branch.md | 16 ++++++++++++++++
 Clone-a-specific-branch.md | 11 -----------
 Deleting-A-Branch.md       | 25 +++++++++++++++++++++++++
 Deleting-a-branch.md       |  3 ---
 Git-Pull-Vs-Git-Fetch.md   | 22 ++++++++++++++++++++++
 Git-Pull-vs-Git-Fetch.md   | 18 ------------------
 Git-Shortcut.md            | 10 ++++++++++
 Git-shortcut.md            | 10 ----------
 8 files changed, 73 insertions(+), 42 deletions(-)
 create mode 100644 Clone-A-Specific-Branch.md
 delete mode 100644 Clone-a-specific-branch.md
 create mode 100644 Deleting-A-Branch.md
 delete mode 100644 Deleting-a-branch.md
 create mode 100644 Git-Pull-Vs-Git-Fetch.md
 delete mode 100644 Git-Pull-vs-Git-Fetch.md
 create mode 100644 Git-Shortcut.md
 delete mode 100644 Git-shortcut.md

diff --git a/Clone-A-Specific-Branch.md b/Clone-A-Specific-Branch.md
new file mode 100644
index 0000000..82db81b
--- /dev/null
+++ b/Clone-A-Specific-Branch.md
@@ -0,0 +1,16 @@
+#Clone a specific branch
+
+There are many cases where we want to clone a particular branch. For those, we need to run the following command:
+
+````
+// E.g. git clone -b <branch_name> <remote_repo>
+git clone -b wiki bugfixing
+````
+
+
+In the following, please note how a public key setup is required. If you don't have a public key already set, you can also clone by using this: 
+
+```
+// Example, with OpenCV 2.4 branch:
+git clone -b 2.4 --single-branch https://github.com/Itseez/opencv.git opencv-2.4
+```    
diff --git a/Clone-a-specific-branch.md b/Clone-a-specific-branch.md
deleted file mode 100644
index 2b055d5..0000000
--- a/Clone-a-specific-branch.md
+++ /dev/null
@@ -1,11 +0,0 @@
-<h1>Clone a specific branch</h1>
-
-<p>There are many cases where we want to clone a particular branch. There we need to follow these commands: </p>
-    git clone -b <branch_name> <remote_repo>    
-  <p>Example</p>
-  `git clone -b wiki bugfixing`   
-<p>This will help to clone specific branch. Please note here public key setup is required. If you don't have public key setup then also you can clone by</p>
-<p>Example, with OpenCV 2.4 branch:</p>
-    git clone -b 2.4 --single-branch https://github.com/Itseez/opencv.git opencv-2.4    
-    
-  
diff --git a/Deleting-A-Branch.md b/Deleting-A-Branch.md
new file mode 100644
index 0000000..09e39d8
--- /dev/null
+++ b/Deleting-A-Branch.md
@@ -0,0 +1,25 @@
+#Delete a Git branch both locally and remotely:
+
+```
+// locally ((if you know what you are doing!)
+git branch -d localBranchName
+
+// and then if you need to...
+// on remote
+git push origin :remoteBranchName
+```
+
+To delete a local branch
+
+git branch -d the_local_branch
+To remove a remote branch (if you know what you are doing!)
+
+git push origin :the_remote_branch
+Note
+
+If you get the error `error: unable to push to unqualified destination: remoteBranchName The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on the source ref. error: failed to push some refs to 'git@repository_name'`
+perhaps someone else has already deleted the branch. Try to synchronize your branch list using
+```
+git fetch -p 
+```
+The git manual says -p, --prune After fetching, remove any remote-tracking branches which no longer exist on the remote.
diff --git a/Deleting-a-branch.md b/Deleting-a-branch.md
deleted file mode 100644
index 72e7555..0000000
--- a/Deleting-a-branch.md
+++ /dev/null
@@ -1,3 +0,0 @@
-<h1>Delete a Git branch both locally and remotely:<h1>
-
-''' git push origin --delete <branchName>'''
diff --git a/Git-Pull-Vs-Git-Fetch.md b/Git-Pull-Vs-Git-Fetch.md
new file mode 100644
index 0000000..8e46a95
--- /dev/null
+++ b/Git-Pull-Vs-Git-Fetch.md
@@ -0,0 +1,22 @@
+#Git Pull vs Git Fetch:
+
+These two commands are regularly used by git users. Let's see the difference between both commands.
+
+
+For the sake of context, it's worth remembering we're probably working in a clone repo. What's a clone? simply a duplicate of another repository. 
+It is basically getting your own copy of someone else's source code.
+
+That said, to keep your clone updated with whatever changes may have been applied to the original, you'll need to bring those to your clone. That's where `fetch` and `pull` come in. `git fetch` is the command that tells your local git to retrieve the latest meta-data info from the original (yet doesn't do any file transfering. It's more like just checking to see if there are any changes available). `git pull` on the other hand does that AND brings (copy) those changes from the remote repository.
+
+E.g.
+```
+git pull origin ankur bugfix         
+```
+
+The take away is to keep in mind that there generally are at least three copies of a project on your workstation. One copy is your own repository with your own commit history (the already saved one, so to say). The second copy is your working copy where you are editing and building (not committed yet to your repo). The third copy is your local "cached" copy of a remote repository (probably the original from where you cloned yours).
+You can use `git fetch` to know the changes done in the remote repo/branch since your last pull. This is useful to allow for checking before doing an actual pull, which could change files in your current branch and working copy (and potentially losing your changes, etc).
+
+```
+git fetch    
+git diff ...origin
+```
diff --git a/Git-Pull-vs-Git-Fetch.md b/Git-Pull-vs-Git-Fetch.md
deleted file mode 100644
index 559a772..0000000
--- a/Git-Pull-vs-Git-Fetch.md
+++ /dev/null
@@ -1,18 +0,0 @@
-<h1>Git Pull vs Git Fetch:</h1>
-
-These two commands are regularly used by git users. Let's see the difference between both commands.
-
-
-A clone is simply a copy of a repository. It is something like where you can download source code from some other repository.
-<b>git fetch</b> is the command that says "bring my local copy of the remote repository up to date."
-<b>git pull</b> says "bring the changes in the remote repository where I keep my own code."
-Normally when use <b>git pull</b> , it does the same thing done by <b>git fetch</b> to bring the local copy of the remote repository(up-to-date), and then merging the changes into own code repo.Example
- 
-     git pull origin ankur bugfix         
-
-
-The take away is to keep in mind that there are often at least three copies of a project on your workstation. One copy is your own repository with your own commit history. The second copy is your working copy where you are editing and building. The third copy is your local "cached" copy of a remote repository.
-One can use     git fetch     to know the changes done in the remote branch since your last pull since. So you can check before doing an actual pull, which could change files in your current branch and working copy.
-
-    git fetch    
-    git diff ...origin    
diff --git a/Git-Shortcut.md b/Git-Shortcut.md
new file mode 100644
index 0000000..9691add
--- /dev/null
+++ b/Git-Shortcut.md
@@ -0,0 +1,10 @@
+#Git shortcut
+
+For most developers, a lot of our time is spent in Terminal and a majority of it is spent typing Git commands. 
+We've created a set of keyboard shortcuts with Bash aliases and functions to speed up your workflow and save hundreds of keystrokes every day.
+
+Git allows you to set aliases but they’re limited and only save you a few keystrokes (i.e. instead of git checkout you can type git co, but you still have to type git). Since Bash is Terminal’s default command-line interpreter, you can also set Bash aliases to reduce your keystrokes even further.
+
+Here’s a list of Git Bash aliases and functions. To use them as your own, just add them to the file you store your aliases/functions in. (i.e. ~/.bash_profile or ~/.bashrc)
+
+When copy & pasting, it’s important to keep the spacing. (i.e. for aliases, there must be no spaces before and after the equal signs, and for functions, there must be a space after the opening curly bracket of the declaration and a semicolon after the command. Don’t forget to reload your file (source ~/.bash_profile) or restart Terminal after making changes.
diff --git a/Git-shortcut.md b/Git-shortcut.md
deleted file mode 100644
index c5369fc..0000000
--- a/Git-shortcut.md
+++ /dev/null
@@ -1,10 +0,0 @@
-<h1> Git shortcut</h1>
-<p>A lot of my time is spent in Terminal and a majority of it is spent typing Git commands. I created a set of keyboard shortcuts with Bash aliases and functions to speed up my workflow and save me hundreds of keystrokes every day.</p>
-
-Git allows you to set aliases but they’re limited and only save you a few keystrokes (i.e. instead of git checkout you can type git co, but you still have to type git). Since Bash is Terminal’s default command-line interpreter, you can also set Bash aliases to reduce your keystrokes even further.
-
-Here’s my list of Git Bash aliases and functions. To use them as your own, just add them to the file you store your aliases/functions. (i.e. ~/.bash_profile or ~/.bashrc)
-
-Notes: If you’ve never set an alias before, don’t know where to put them, or have no clue what I’m talking about, read my post on Terminal/Bash Command-Line Shortcuts with Aliases before continuing.
-
-When copy & pasting, it’s important to keep the spacing. (i.e. for aliases, there must be no spaces before and after the equal signs, and for functions, there must be a space after the opening curly bracket of the declaration and a semicolon after the command. Don’t forget to reload your file (source ~/.bash_profile) or restart Terminal after making changes.
