User Tools

Site Tools


haas:fall2019:common:repo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
haas:fall2019:common:repo [2016/08/20 21:26] – external edit 127.0.0.1haas:fall2019:common:repo [2019/08/18 16:08] (current) wedge
Line 6: Line 6:
 |yourusername  |  Instead of writing 'yourusername', replace with your actual Lab46 username you use to log in  | |yourusername  |  Instead of writing 'yourusername', replace with your actual Lab46 username you use to log in  |
  
-=====Avoiding an unnecessary error=====+=====Cloning Locally (on Lab46)===== 
 +To clone your mercurial repository, run the 'fixrepo' script and follow any prompts: 
 + 
 +<cli> 
 +lab46:~$ fixrepo 
 +</cli> 
 + 
 + 
 +=====Cloning Remotely (Home or Other Computer)===== 
 +Perform this step ONLY if you wish to access your lab46 repository from your home computer (ie if you want a local copy, and are not using an SSH client to access your data). For most of you, this step is not necessary, and you should skip it. 
 + 
 +In order to use your repository, you must first **clone** it. Note that this is only for additional copies of the repository you wish to work with, in addition to the "local" copy we cloned above on lab46. 
 + 
 +====Avoiding an unnecessary error====
 **NOTE:** New accounts will not have a **~/src** directory, thereby obsoleting this step. If you do not currently have a **~/src** subdirectory, you may proceed to the next step. **NOTE:** New accounts will not have a **~/src** directory, thereby obsoleting this step. If you do not currently have a **~/src** subdirectory, you may proceed to the next step.
  
Line 20: Line 33:
 </cli> </cli>
  
-Proceed with the instructions. 
- 
-=====Cloning Locally (on Lab46)===== 
-In order to use your repository, you must first **clone** it: 
- 
-<cli> 
-lab46:~$ hg clone http://www/hg/user/yourusername ~/src 
-http authorization required 
-realm: Lab46/LAIR Mercurial Repository (Authorization Required) 
-user: yourusername 
-password: 
-no changes found 
-updating to branch default 
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved 
-lab46:~$  
-</cli> 
- 
- 
-=====Cloning Remotely (Home Computer)===== 
-Perform this step ONLY if you wish to access your lab46 repository from your home computer (ie if you want a local copy, and are not using an SSH client to access your data). For most of you, this step is not necessary, and you should skip it. 
- 
-In order to use your repository, you must first **clone** it. Note that this is only for additional copies of the repository you wish to work with, in addition to the "local" copy we cloned above on lab46. 
 ====CLI==== ====CLI====
 If you're using a command-line interface on your remote machine: If you're using a command-line interface on your remote machine:
Line 63: Line 54:
 http://lab46.corning-cc.edu/hg/user/yourusername http://lab46.corning-cc.edu/hg/user/yourusername
 </cli> </cli>
-=====Return to src=====+ 
 +====Return to src====
 Having finished the chicken-and-egg file management aspect of bootstrapping our repository activities, we need to remember to change back into our **src** directory before continuing: Having finished the chicken-and-egg file management aspect of bootstrapping our repository activities, we need to remember to change back into our **src** directory before continuing:
  
Line 70: Line 62:
 lab46:~/src$  lab46:~/src$ 
 </cli> </cli>
-=====Restoring original src contents=====+ 
 +====Restoring original src contents====
 If you did that initial step to avoid encountering errors, you'll also want to perform this step to complete the process. If you did that initial step to avoid encountering errors, you'll also want to perform this step to complete the process.
  
Line 91: Line 84:
 If you got an error to the tune of "directory not empty", there is still something there and you may want to investigate that. However, the current state of **~/src.bak** will not impact our efforts here, so successful or not, we can proceed to the next step. If you got an error to the tune of "directory not empty", there is still something there and you may want to investigate that. However, the current state of **~/src.bak** will not impact our efforts here, so successful or not, we can proceed to the next step.
  
-=====Customizing your Settings=====+====Customizing your Settings====
 Mercurial uses a **.hg** located at the base of your repository to store important information. Most of it you will not have any need to directly look at (but you should take care to preserve that data as it manages how your repository works). Mercurial uses a **.hg** located at the base of your repository to store important information. Most of it you will not have any need to directly look at (but you should take care to preserve that data as it manages how your repository works).
  
Line 127: Line 120:
 Obviously, if you are accessing your repository from a home or computer that is on a network foreign to the LAIR, be sure to substitute **www** with **lab46.corning-cc.edu** Obviously, if you are accessing your repository from a home or computer that is on a network foreign to the LAIR, be sure to substitute **www** with **lab46.corning-cc.edu**
  
-=====Ignoring Files=====+====Ignoring Files====
 Just as it is important to track changes to files, we also want the ability to ignore certain files. Mercurial provides a facility for this, and it is a set of patterns located in a file called **.hgignore**, located in the base of your repository (not in **.hg**, but a sibling file). Just as it is important to track changes to files, we also want the ability to ignore certain files. Mercurial provides a facility for this, and it is a set of patterns located in a file called **.hgignore**, located in the base of your repository (not in **.hg**, but a sibling file).
  
Line 151: Line 144:
 Why would this be useful? Well, for one we don't wish to track temporary files that might be created by a text editor, that contain no useful information. Also, we really have no need to track object and compiled files- it is the text and source files that are most valuable to us. Why would this be useful? Well, for one we don't wish to track temporary files that might be created by a text editor, that contain no useful information. Also, we really have no need to track object and compiled files- it is the text and source files that are most valuable to us.
  
-=====Checking for changes=====+=====Care and Feeding of your Repository===== 
 + 
 +====Checking for changes====
 Let's assume you created that **.hgignore** file from the section above. This is a great file to track in Mercurial, so we will use it as an example. Let's assume you created that **.hgignore** file from the section above. This is a great file to track in Mercurial, so we will use it as an example.
  
Line 159: Line 154:
 lab46:~/src$ hg status lab46:~/src$ hg status
 ? .hgignore ? .hgignore
-? Makefile 
 lab46:~/src$  lab46:~/src$ 
 </cli> </cli>
Line 165: Line 159:
 In this case, we see Mercurial has noticed a new file, **.hgignore**, and its status is unknown (hence the **?**), it will also pick up on any other files you have located in this directory. In this case, we see Mercurial has noticed a new file, **.hgignore**, and its status is unknown (hence the **?**), it will also pick up on any other files you have located in this directory.
  
-=====Adding a file for tracking=====+====Adding a file for tracking====
 As I said, we want to track this file, so we need to tell Mercurial to pay regular attention to it. We do that with the **hg add** command (note that we only have to **add** files to the repository once): As I said, we want to track this file, so we need to tell Mercurial to pay regular attention to it. We do that with the **hg add** command (note that we only have to **add** files to the repository once):
  
Line 171: Line 165:
 lab46:~/src$ hg add lab46:~/src$ hg add
 adding .hgignore adding .hgignore
-adding Makefile 
 lab46:~/src$  lab46:~/src$ 
 </cli> </cli>
Line 180: Line 173:
 lab46:~/src$ hg status lab46:~/src$ hg status
 A .hgignore A .hgignore
-A Makefile 
 lab46:~/src$  lab46:~/src$ 
 </cli> </cli>
Line 186: Line 178:
 You should see that the original "**?**" status of the file has been altered to "**A**". That is *A* as in **A**dd. You should see that the original "**?**" status of the file has been altered to "**A**". That is *A* as in **A**dd.
  
-=====Committing changes to the repository=====+====Committing changes to the repository====
 In order for Mercurial to work its magic, we need to get the changes committed to the repository. For us, this will be a two-step process- we need to **commit** any changes, and then **push** them to the LAIR repository. In order for Mercurial to work its magic, we need to get the changes committed to the repository. For us, this will be a two-step process- we need to **commit** any changes, and then **push** them to the LAIR repository.
  
Line 214: Line 206:
 remote: adding manifests remote: adding manifests
 remote: adding file changes remote: adding file changes
-remote: added 1 changesets with 1 change to files+remote: added 1 changesets with 1 change to files
 lab46:~/src$  lab46:~/src$ 
 </cli> </cli>
Line 223: Line 215:
  
 <WRAP warning round>**ATTENTION**: You are done! At this point, you are done with the basic bootstrapping process of getting your repository cloned.</WRAP> <WRAP warning round>**ATTENTION**: You are done! At this point, you are done with the basic bootstrapping process of getting your repository cloned.</WRAP>
-=====Pulling changes from a repository=====+ 
 +====Pulling changes from a repository====
 <WRAP info round>**NOTE:** If you have multiple copies of a repository, you'll need to **pull/update** on each one to keep them all up to date, as they are each an independent copy.</WRAP> <WRAP info round>**NOTE:** If you have multiple copies of a repository, you'll need to **pull/update** on each one to keep them all up to date, as they are each an independent copy.</WRAP>
  
Line 256: Line 249:
  
 The changes are now visible in your copy of the repository. The changes are now visible in your copy of the repository.
-=====Other=====+ 
 +====Other====
 There are other actions or situations you may encounter while using Mercurial. Conflicts, branches, heads, the need to merge, and even pulling out old versions. But for now, get used to the basics. There are other actions or situations you may encounter while using Mercurial. Conflicts, branches, heads, the need to merge, and even pulling out old versions. But for now, get used to the basics.
  
 Mercurial has a help screen, that can be accessed by issuing the command: **hg help** Mercurial has a help screen, that can be accessed by issuing the command: **hg help**
  
-=====Bitbucket on Lab46====+====Bitbucket on Lab46==== 
- +Should you be required to utilize Bitbucket (perhaps as part of some other class), it is possible to clone your Bitbucket repository on Lab46. This will allow you to commit files to your Bitbucket repository without the use of tools such as TortoiseHg.
-Should you be required to utilize Bitbucket, it is possible to clone your Bitbucket repository on Lab46. This will allow you to commit files to your Bitbucket repository without the use of tools such as TortoiseHg.+
  
 First, clone your repository. First, clone your repository.
haas/fall2019/common/repo.1471728405.txt.gz · Last modified: 2016/08/20 21:26 by 127.0.0.1