Mecurial / Tortoisehg: Setting up a Source Control Repository on HTTP

Hi,

Install the following

http://tortoisehg.bitbucket.org/download/index.html

One this is installed we will:

  • Create a Repository where our source code will sit.
  • Create a clone where our working location is
    STEP 1: Create the Repository

So, the first step is to allocate a folder for the repository:

My repository folder is called:

PhotoRARepository

We will then right click the folder and select Create Repository:

image

We just confirm the destination as the same place:

image

Cool, now we need to publish the repository to the web.

Right click the folder and go to repository explorer.

image

Then in the explorer go to Tools->Settings and configure HTTP/HTTPS and port number to listen on:

image

Once this is done, click the Server Button!

image

You will see a window open that is listening on this new port:

image

That’s it we done.

We can also updated the .hgignore file to ignore checking in these files:

image

# Ignore file for Visual Studio 2008

# use glob syntax
syntax: glob

# Ignore Visual Studio 2008 files
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.lib
*.sbr
*.scc
[Bb]in
[Dd]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml

 

Next, you need to activate the files in the repository, by adding them, if you got existing files already in the folder!

image

 

Once this is done, you COMMIT them to the repository:

image

Confirm all the files and we done on the Master repository side:)

image

Double check all files have a nice green tick:

image

If you go back to the repository explorer the history should now be there after the commit.

image

    STEP 1: Clone the Repository from a developer machine

 

Note: if you have the master repository, you still need to clone it and use the clone, never use the repository directly!)

To use the repository, you need to create another folder on ALL users machines that will use the source control. To do this, they will CLONE the repository.

So if you are the only user of the project, you will STILL need to clone it, that means if your computer is the repository and you want to use the source control, you must also clone it.

So i created a new folder called PhotoRA, which will be my clone. I right click the folder and select Clone:

image

Then specify the web URL.

image

Once done, it will automatically fill the folder and you can now use Visual Studio and start coding.

image

We can test this, by opening the solution editing the file and committing it to the repository.

I went an updated the web.config file in my clone repository using Visual Studio. Now I right click the clone folder and commit.

image

Next I right click my clone folder and select repository explorer and I see the history, I can now PUSH it up to the main repository.

image

You can see all the chit chat in the HTTP Server Log:

image

Never edit files directly in the MAIN repository!

 

Repeat STEP 2 for ALL developers using your repository πŸ™‚

That’s it πŸ™‚

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s