Getting started...
| Open ConEmu (if installed) | View » Other Windows » ConEmu Console (ctrl w, ctrl w) |
| choco install git | Install git if not installed |
| Notice: may have to close cmd window and re-open | |
|---|---|
| git help | (to verify installed) |
| git config --global user.email "jeff32819@gmail.com" | Add email to config |
| git config --global user.name "Jeff32819" | Add email to config |
| git config -l | list config settings |
| git init | The first step is to initialize a new Git repo locally in your project root |
| git remote add origin https://github.com/jeff32819/<project_name>.git | associates the local repository with the remote github |
| git remote set-url origin https://github.com/jeff32819/<project_name>.git | Change (if moved) the local repository with the remote github |
| git remote -v | see all remote repositories for your local repository |
| git remote show origin | get more info about a remote repo in Git |
| Start: these commands used for each commit | |
| git status | check status to see if any changes need to be committed |
| git add . | Add all files |
git reset
git reset <file> |
Undo file(s) added |
| git commit -m "MY MESSAGE HERE" | makes the commit locally |
| git commit -a -m "MY MESSAGE HERE" | Combines the 2 commands above (add all and commit) |
| git push | push changes to github.com, current branch |
| git push -u origin master | push a new branch to a remote repo in Git |
| Stop: these commands used for each commit | |
| git log | This command shows the commit history for the current repository |
| git shortlog | This command shows the commit history for the current repository |
| git log origin/master | logs for specified branch |