Difference between revisions of "Git"

From CSE473 Wiki
Jump to navigation Jump to search
(Created page with "This year, our labs are hosted on [https://bitbucket.org bitbucket], which is a version control system that uses [https://bitbucket.org git]. If you are not familiar with git...")
 
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
The '''MOST COMMON''' mistake students make is to omit the <span style="font-family:Courier;">''git push''</span> command, so that while their solution is correctly updated in their local repository, this final version is not propagated to the remote directory that we use to timestamp submissions and grade.  You should, therefore, '''always''' make sure to verify that you have uploaded your lab solution and report to the remote repository and done a <span style="font-family:Courier;">''git push''</span> before the lab due date.
 
The '''MOST COMMON''' mistake students make is to omit the <span style="font-family:Courier;">''git push''</span> command, so that while their solution is correctly updated in their local repository, this final version is not propagated to the remote directory that we use to timestamp submissions and grade.  You should, therefore, '''always''' make sure to verify that you have uploaded your lab solution and report to the remote repository and done a <span style="font-family:Courier;">''git push''</span> before the lab due date.
  
As far as getting access to the remote repository is concerned, you will receive an invitation email that will include instructions on how to get a local copy of the repository on your machine(s).  You will need an account on [https://bitbucket.org bitbucket], and if you don't already have one, you will be givent the opportunity to create one.
+
As far as getting access to the remote repository is concerned, you will receive an invitation email that will include instructions on how to get a local copy of the repository on your machine(s).  You will need an account on [https://bitbucket.org bitbucket], and if you don't already have one, you will be given the opportunity to create one.
  
Once you have a local copy of the repository on a machine, you can sync it up with the remote repository using a ''pull'' command, ''i.e.,'' <span style="font-family:Courier;">''git pull''</span>.  This will update your local repository to mirror the content of the remote repository.  You will need to do this before each new lab assignment to retrieves copies of the files associated with the assignment.  You will be sent an email reminding you to do so.
+
Once you have a local copy of the repository on a machine, you can sync it up with the remote repository using a ''pull'' command, ''i.e.,'' <span style="font-family:Courier;">''git pull''</span>.  This will update your local repository to mirror the content of the remote repository.  Although your repository should come loaded with the files for all the six labs of the course (only the code though, as the reports are on the [[Labs|Labs tab]] of the wiki), you may need to do a new pull before each new lab assignment in case some of the files have been modified.  You will be sent an email reminding you to do so before each lab in case it is needed.

Latest revision as of 22:59, 29 August 2019

This year, our labs are hosted on bitbucket, which is a version control system that uses git. If you are not familiar with git, here is a reasonably good tutorial on how it works and how to use it. It is written for Unix/Linux and from a command line perspective, but should provide you with a good overview of what git does and how to use it.

For those who are familiar with svn, another version control software, the two are very similar when it comes to the steps involved in getting stuff from and to the remote repository that you will use to both get lab assignments and for submitting your solution code and reports. The main difference between the two is that while svn only requires a commit operation, git requires a three step process (see Figure 4 of the tutorial), namely stage (this uses git add) that makes a new or modified file (or files) ready to be committed, commit (this uses git commit) that makes the new/changed files part of your local repository, and finally push (this uses git push) that ultimately uploads your new or modified file to the remote repository.

The MOST COMMON mistake students make is to omit the git push command, so that while their solution is correctly updated in their local repository, this final version is not propagated to the remote directory that we use to timestamp submissions and grade. You should, therefore, always make sure to verify that you have uploaded your lab solution and report to the remote repository and done a git push before the lab due date.

As far as getting access to the remote repository is concerned, you will receive an invitation email that will include instructions on how to get a local copy of the repository on your machine(s). You will need an account on bitbucket, and if you don't already have one, you will be given the opportunity to create one.

Once you have a local copy of the repository on a machine, you can sync it up with the remote repository using a pull command, i.e., git pull. This will update your local repository to mirror the content of the remote repository. Although your repository should come loaded with the files for all the six labs of the course (only the code though, as the reports are on the Labs tab of the wiki), you may need to do a new pull before each new lab assignment in case some of the files have been modified. You will be sent an email reminding you to do so before each lab in case it is needed.