Because it is the best tool, not because it is perfect or easy.
(it won)
We teach you a few commands, just enough to get started. We teach you simple workflows that will teach you to effectively use git. Git has tons of commands. Don't try to learn them all. Learn them as you need them. We will show you which ones to get started with.
We do not recommend, nor do we teach you how to use graphical interfaces/ apps for git. They are handy for some people, especially those who already understand git. But please do not use one during this class. Use the command line only.
Repo/ Repository: a place to put your stuff where git can keep track of it.
...if you haven't already
git install page...and if you don't have Mac OS 10.9 or 10.10 .... this might get complicated
git config --global user.name "your name"
git config --global user.email email@provider.com
git config --global -l
git config --global push.default current
git config --global merge.defaulttoupstream true
*For greatest convenience, do not create a passphrase with your ssh key. It is an extra and arguably unnecessary layer of security.
This repo is designed for you to be able to turn in your assignments. It will also set you up to be able to collaborate with classmates and future coworkers.
clone the repo from github (in your case, a homework assignment or activity repo)
Change directories to the directory you want to put your work in.
cd dev
Optionally, make a pcs or dev directory into which you will put all of your assignment repos.
mkdir pcs
don't forget to change directories into that directory
cd pcs
Clone the repository from github (the one in which you clicked the little button)
git clone git@github.com:portlandcodeschool/jse-fall15-1.git
Change directories into the repo you just cloned:
cd some-directory
If you are not sure which directory you are in, type:
pwd
To see what is in your current directory, type:
ls
Before you do anything else: make a new repo branch with your name!
git checkout -b yourNameHere
This keeps any changes you make out of the master branch until it's time to merge them.
In addition, so we're protected by both belt and suspenders, put all of your changes in a subdirectory with your name:
mkdir yourNameHere
Then move to that directory:
cd yourNameHere
Don't modify the original assignment files or README.md
If you need to modify them, copy them somewhere else first.
Now you can safely create and edit files. You can create files with the touch command, like this:
touch file-1.js
touch index.html
touch instructions.md
You can check the status of your git repository like this:
git status
You can add files for git to track like this:
git add name-of-file.js
You will need to make commits so that git will "save" your code
git commit -m "make changes to all the things"
Don't forget the -m .... you'll be sorry ;-)
Next, we need to get our code "saved" to github, our remote repository:
git push
Head back over to github