Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Github - setup and configuration

leveton
April 13, 2012

Github - setup and configuration

Making keys, pulling and pushing to the repository, working with teams

leveton

April 13, 2012
Tweet

More Decks by leveton

Other Decks in Programming

Transcript

  1. Working with Github In the second part of this tutorial,

    you're going to download an Sdsol project that we store on Github, create a replica of the project (called a branch), do some work on the branch, merge the branch with the original (called master), and push your local master back to Github.
  2. Working with Github • Go to www.github.com/sdsol-tech/Timecard • This is

    the root of the project, copy the HTTP string • Now in the terminal cd to your projects directory and enter 'git clone [the string you just copied] • You should now have a local copy of the project Do not download the zip!
  3. Working with Github To begin work, checkout a new branch.

    Run.. git checkout -b [something descriptive!] • Now you can change any file without disturbing master. You then add any file you've changed to a staging area before committing the file to your local git datastore. You then ensure that your local master branch is up-to-date, merge your changes with your local master, and finally push the new master up to Github. Here are the steps...
  4. The main 6 steps 1) git add . 2) git

    commit -m 'some message describing your work' 3) git checkout master 4) git pull 5) git merge [the name of your branch] 6) git push • Note: git pull should never involve a local merge because you are never working directly with master. Your back in the master branch The dot indicates all files Make sure your local master is up to date
  5. Working with Github Merge conflicts • After merging (step 5),

    you may have conflicts if another team member worked on the same file that you worked on. Use your diff tool to resolve these conflicts and merge again. Cleaning up git branch -d [something descriptive!] • This deletes your merged branch. Careful! Make sure your branch was successfully merged with master first.
  6. Working with Github • To see the files you changed,

    go to Github and hit the ‘history’ button at the right of the file. To see your exact changes, hit the hex string that git creates for each commit – red shows what was removed, green shows what was added – a very nice interface! The red line was removed, the green added. Hex string for commit, leads to this
  7. Working with Github • You, the team leader, and your

    team members can discuss the changes that you made via the 'issues' tab at the root of the project. A complete commit History for the project
  8. Xcoders... • Git is built into Xcode. • Xcode prompts

    you to create a local git repo when starting a new project
  9. Thank you • After pushing your changes to master, all

    team members can pull the modified project onto their local machines so that everyone is up-to-date. git pull • I encourage you to explore Github – there are many more features. Please email me any questions [email protected]