Snippets

Robb Gosset Git cheat-sheet

Updated by Robb Gosset

File snippet.markdown Modified

  • Ignore whitespace
  • Hide word diff
 
 To commit your changes:
 
-* Type `git add` followed  by the files that you have changed (remeber directory names if they are in folders, eg images/banner.png) (You can use `git add .` to add all files that have changes)
+* Type `git add` followed  by the files that you have changed (remeber directory names if they are in folders, eg 'images/banner.png') (You can use `git add .` to add all files that have changes)
 * Type `git commit -m "<<description of changes here>>"` and press return to commit changes to your local copy
 
 To push changes to the cloud:
Updated by Robb Gosset

File snippet.markdown Modified

  • Ignore whitespace
  • Hide word diff
 
 To commit your changes:
 
-* Type `git add` followed  by the files that you have changed (remeber directory names if they are in folders, eg images/banner.png) (You can use "git add ." to add all files that have changes)
+* Type `git add` followed  by the files that you have changed (remeber directory names if they are in folders, eg images/banner.png) (You can use `git add .` to add all files that have changes)
 * Type `git commit -m "<<description of changes here>>"` and press return to commit changes to your local copy
 
 To push changes to the cloud:
Updated by Robb Gosset

File snippet.markdown Modified

  • Ignore whitespace
  • Hide word diff
 
 * Type `git pull` and any new commits in the cloud will be pulled and merged with your local copy.
 * If you get a message similar to the following:
-    CONFLICT (content): Merge conflict in contributors.txt
-    Automatic merge failed; fix conflicts and then commit the result.
+
+		CONFLICT (content): Merge conflict in contributors.txt
+		Automatic merge failed; fix conflicts and then commit the result.
+	
 * Then there are merge conflicts, open the files named by git in the error message and find the merge conflicts, they will look like the following:
 
 		<<<<<<< HEAD:mergetest
Updated by Robb Gosset

File snippet.markdown Modified

  • Ignore whitespace
  • Hide word diff
 To Login:
 =========
 
-If you are using a UWE computer:
+If you are using a UWE computer on windows:
 
 * Open Putty and enter `milly.cems.uwe.ac.uk` into the address box and click connect
 * Type in your UWE username and press return
 * Type in your UWE password and press return (nothing will show on screen as you type)
-* Type cd ~/public_html/DSA/twin-cities
+* Type `cd /your/repo/path`
 
-If you are using a non-UWE computer:
+If you are using a non-UWE computer on windows:
 
 * Open Putty and enter `ras.cems.uwe.ac.uk` into the address box and click connect
 * Type in your UWE username and press return
 * Type in your UWE password and press return (nothing will show on screen as you type)
 * Type `cd /your/repo/path`
 
+If you are on Linux then replace Putty with a terminal SSH client.
+
 To see what's changed:
 
 * Type `git status` this will show what files have changed and what's staged for commit
Updated by Robb Gosset

File snippet.markdown Modified

  • Ignore whitespace
  • Hide word diff
 		This is a fourth line I am adding
 		>>>>>>> 4e2b407f501b68f8588aa645acafffa0224b9b78:mergetest
 		
-		`<<<<<<<` : Indicates the start of the lines that had a merge conflict. The first set of lines are the lines from the file that you were trying to merge the changes into.
-		`=======` : Indicates the break point used for comparison. Breaks up changes that user has committed (above) to changes coming from merge (below) to visually see the differences.
-		`>>>>>>>` : Indicates the end of the lines that had a merge conflict. 
+		
+		<<<<<<< : Indicates the start of the lines that had a merge conflict. The first set of lines are the lines from the file that you were trying to merge the changes into.
+		======= : Indicates the break point used for comparison. Breaks up changes that user has committed (above) to changes coming from merge (below) to visually see the differences.
+		>>>>>>> : Indicates the end of the lines that had a merge conflict. 
+		
 * Look at the linex between the indicators, manually change them to resolve the confilct, save the file and commit and push your changes.
  1. 1
  2. 2
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.