Setting up Github on a new computer
git, github, macos, ruby-on-rails
Solution
Go through this book, http://progit.org/book/ and http://gitcasts.com/ for video tutorial.
And I recommend you follow these steps
- Clone the repository (git clone repoAddress)
- create a new branch (git branch branchName)
- checkout that branch (git checkout branchName)
- make changes and commit in that branch (git add files)
- checkout master (git checkout master)
- perform a pull (it updates the local repository with the remote one) git pull
- If there is change, checkout the branch and rebase it with local master
- If there is conflict resolve it and add that file and make a commit again
- checkout master again and merge the branch (git merge branch)
- push the commits to the remote repository.(git push)
If you want a GUI tool, then there is GitX which is made for Mac OS X. http://gitx.frim.nl/
Problem
I am an almost perfect beginner at Github so please humor me with this elementary question. I have a laptop PC that I've been using to interact with a repo on Github. I just bought a Mac and I would like to do my programming on both machines. I have installed Git on the new machine and I have set up my username, e-mail, and Github token on the Terminal. What are the basic commands I need to do this: - Download the repo from Github the first time? I've created a new folder on my Mac but going there and typing `git pull git@github.com/sscirrus/repo.git` produces `fatal: not a repository (or any of the parent directories): .git`. - Upload those changes again such that the main repo is updating cleanly with each new push. I assume that once I have the code in my new folder, it would be a matter of `git add .` and `git push` with password entry? I am reading through tutorials on Git but just want to make sure I'm doing something sensible for my situation before my newbieness screws up a lot of prior work. Thank you!