you to store your changes! Github allows you to store your changes remotely. GIT stores the file content in BLOBs (binary large objects). The folders are represented as trees. https://github.com/images/error/octocat_happy.gif
repo • git status ◦ to check what files changed from the last commit • git diff (--cached) ◦ to see what was changed from last commit (if you did add already) • git add . ◦ to add all changed files to commit • git add <file1> ◦ to add file with name 'file1' to commit • git commit -m <"My commit msg"> ◦ to add changes to your local history • git log ◦ to see the history of your project
ssh keys are set up, and global user is set too. http://help.github.com/mac-set-up-git/ 2. git clone <[email protected]:username/RepositoryName.git> - to create a copy of remote repository on your local machine http://help.github.com/fork-a-repo/
branches and on which you are currently on • git checkout <branch-name> ◦ switch to the branch called 'branch-name' • git checkout -b <branch-name> ◦ create&checkout a new branch called 'branch-name' off the branch on which you are currently on • git fetch ◦ download new branches and data from remote repo • git push origin <branch-name> ◦ push your branch and data to remote repo • git pull origin <branch-name> ◦ fetch from remote repo and try to merge into current branch
branch into the current branch Usually there are conflicts that need to be resolved: Solving them: Then: git add file.txt and git commit -m "Solved conflict" • git reset --hard HEAD ◦ reverts to pre-merged state if you haven't committed ◦ use ORIG_HEAD if you committed merge and want to throw it away http://book.git-scm.com/3_basic_branching_and_merging.html Alternative to merging is rebasing.
<SHA> ◦ compare you current changes to what one of the previous commits • git show <SHA> ◦ see details about that commit • git tag <tagname> <SHA> ◦ give your own name to commit There are more complicated and dangerous commands that utilize SHA, like git revert and git reset.