First of all, I apologize for not blogging last week. I completely forgot about it.
—————————————————————————————————–
So for last week, I was asked by the professor to make some notes on Git and think about how to organize our code repository. I am not exactly very knowledgeable about Git, but I know how to use it because of my internship at the UMass Lowell Robotics Lab. But at the lab work work in small teams and we contribute our code to the main repository, so I have the basic idea of how this works.
Also, I did not cover how to work with remote (not local) repository in my notes [Chapter 2 ProGit]
To add a remote repository to Git (to set up our CS401 Repo as a remote so you can push and pull updates to and from it), in the command-line, run
git remote add NameForYourRemote URL
So for example, git remote add cs401 https://github.com/CS-Worcester/CS401Spring2013.git
To push to the remote repo, git push NameForYourRemote branchName
ex. git push cs401 master
To fetch, git fetch NameForYourRemote
To pull, git pull NameForYourRemote
The difference between fetch and pull is that the “fetch” only get the new updates, but “pull” gets the update and then “merge” it to your branch.
From the blog ssuksawat » cs-wsu by ssuksawat and used with permission of the author. All other rights reserved by the author.