A Simple Git Guide for Windows Users


Hopefully this will fix some headaches! It took me ages to figure out how to fix things and get it all running by using many, many forums. Mainly for my own reference but might help others.

Written by DannnnB

Basic CMD

  1. cd .. (Up dir)
  2. ls (From git bash) or dir (From CMD/Windows) (List files in dir)
  3. cd Users (Change to dir)

Git Shell & CMD

  1. git clone (Copies a git from a link eg. http://github.com/username/project)
  2. git status (Difference between GitHub and you)
  3. git add (Adds new files/changes by file name into repo commit. git add index.html)
  4. git add . (Adds all files)
  5. git add -A (Adds all files)
  6. git commit (Locked in. Ready to be uploaded. Use: git commit -m "a message of changes)
  7. git push (Take all committed files and uploads/pushes to github.com)
  8. git pull (Pulls latest git commit)
    • git (List all commands)

Simple Workflow

  1. “start”
  2. git pull
  3. “make changes”
  4. git add index.html or git add -A (adds all)
  5. git commit -m "message for commit" (a file or all files)
  6. git push

Merge Conflict

  1. Manually merge conflict lines at helper lines
  2. git add -A
  3. git commit
Stuck in cmd after commit or during one
  • ESC (then) :wq

Branching

  • “All in your working DIR”
  1. git pull (latest files)
  2. git branch (shows master + other branches)
  3. git branch name-of-branch (copies MASTER)
  4. git checkout name-of-branch (changes to branch. Not going to mess with Master.)
  5. git add -A (or) git add filename.html (add edited files)
  6. git branch (branch selection)
  7. git checkout master (back to master)
  8. git pull (check to see if anyone else has updated master)
  9. git checkout name-of-branch
  10. git merge master (merges to master branch)
    • On GitHub submit it as pull request
    • Enables comments, can add commits if needed before merged code changes.

CMDER

####Tab manipulation

  • Ctrl + ` : Global Summon from taskbar
  • Win + Alt + p : Preferences
  • Ctrl + t : New tab dialog
  • Ctrl + w : Close tab
  • Shift + Alt + number : Fast new tab
  • Alt + Enter : Fullscreen
  • Shift + Up : Traverse up in directory structure
  • End, Home, Ctrl : Traverse text as usual on Windows
  • Ctrl + r : History search
  • Shift + mouse : Select and copy text from buffer
  • Right click / Ctrl + Shift + v : Paste text
LearnCode.academy

YouTube Coding

Related Posts

Codecademy Pro Challenge Final

My one month challenge using Codecademy Pro has ended. Come read my final thoughts and what I think about Pro features.

Codecademy Pro Challenge Week 1/2 Update

A one month challenge using Codecademy Pro. Follow me on twitter for updates. HTML/CSS, Javascript, jQuery, AngularJS, Ruby. Read about week 1 and what I think about Pro features. Javascript & jQuery!

Codecademy Pro Full Stack Challenge

A one month challenge using Codecademy Pro. Follow me on twitter for updates. HTML/CSS, Javascript, jQuery, AngularJS, Ruby. Come read my plan and what I'd like to have by the end of it.

Choosing Jekyll over WordPress

Sometimes its better to have less choice. A insight into my struggle with WordPress and having the opportunity of choice.

Career Skills - Learning Your Path Into Development

This video help me on deciding what route I should take while learning. I've ticked off a lot since I saw it a while ago!

Foundation App Guide for Windows Users

A small guide on how to get Foundation Apps working on Windows.