UWPHacks 1 Session on Git, Github, and Command Line:
common commands: (left side is mac/linux, right side is Windows)
man/help - HELP, lost
pwd/cd - present working directory
ls/dir - list files in pwd
mkdir - make directory
cd - change directory
Git is a technology
Github is a service
- open the terminal
- Type ‘git’ if you see something good
- git config –global user.name “Jane Doe”
- git config –global email.name “j26tsang@uwaterloo.ca”
- go to directory you want the repository
- git init
- make a new repository on Github
Connecting Wires
- git remote -v
- git remote add origin “url from github”
- Now “git remote -v” should show (for some fetch and push links)
origin https://github.com/jonathantsang/testisthebest.git (fetch)
origin https://github.com/jonathantsang/testisthebest.git (push)
Let’s Add!
- touch “filename”
- git add “filename”
- git status (Files that have changed)
- git diff (Lines that you added in new files)
- git commit -m”Filename” (commits the code to github)
- git log (log of commits made)
- git push origin master (name and email from beginning steps should be the login info from Github)
$ git push origin master
Username for ‘https://github.com’: jonathantsang
Password for ‘https://jonathantsang@github.com’:
Counting objects: 3, done.
Writing objects: 100% (3/3), 204 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/jonathantsang/testisthebest.git
* [new branch] master -> master