Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


This article helps you to work with a SourceTree program: Clone Repository, Fetch, Pull and Archive.

Tip

In the basis of this article lies concept of using GIT repository for development: dedicated server stores repository and project team downloads/uploads changes from/to it. SourceTree is just a program an application that helps to work with mentioned repositoryGit repositories in a visual and user friendly way.

Prerequisites

How to get the project code on your machine

  1. Please log into services.burti.lv/stash:
        Image RemovedMake sure you are logged in to the Atlassian product suite. You most likely already are, if you are reading this.
    Navigate to https://bitbucket.org/burti

  2. Choose a project from the project list.
    You will be able to see only the projects you have access to:    Image Removed

     

    Please choose a Repository:
        Image Removed

    On the left side under Actions, please click Clone button to clone repository to your computer. 
    Please note that under the "Source" label there is a dropdownImage Added


  3. Choose a Repository.
    A project may contain one or several repositories, and a list of all available repositories is displayed:
    Image Added

  4. On the top right corner of the screen press the Clone button.
    Please note that above the folder/file listing there is a dropdown saying "master", where you can select the branch you would like to clone from. 
    Please go though Go through manual Usage of Git master and develop branches in code deployment to get overall understanding get an overall understanding about the branch concept and how we use it. 
        Image RemovedImage Added

    Tip

    Please note that stash Bitbucket will show you list all the files that repository hasare placed in the root folder of the repository. Usually it will contain just a "halcust" folder, but sometimes also "halpatch" and other folders if they are needed for customisations of the system.


  5. A window with project file and a button Clone in SourceTree will appear. a repository URL and several options and buttons will appear. In the top right corner drop-down select HTTPS instead of SSH.
    Click on Clone in SourceTreeSourcetree.
        Image RemovedImage Added

  6. If Your Browser asks may ask for permission to launch your SourceTree client, please Click on Launch Application.
    If you don't want to see this window again you can mark Remember my choice for all links of this type.
        Image Removed
    Then a window will open where to choose Sourcetree program - kindly allow it to do so.



  7. A window will appear where you need to choose:
     - Checkout branch (see the point 4.),
     - Destination Path (specify location where local files from repository will be stored), 
     - Bookmark Name (local name for repository: since there can be several projects you are working on, please choose convenient name for this repository).
    Then click on click Clone button.
        Image Removed

     

    Please go Image Added

Proceed to the destination path you have selected in the previous step.

...


If running a test environment on the same machine you are cloning this code to - you may either use symbolic links to link needed folders to your development environment or just copy the folders there.

Warning

Due to the fact git folders may contain sensitive information about the repository and user credentials we do not recommend however to send copies of these git folders to somebody else. If you wish to do that - please refer to part Creating an archive.


Tip

Please note

...

next time when you run SourceTree program you may select repositories with bookmark names

...

defined earlier (please see step 7) i.e. you don't have to repeat points 1 to 7 again.

Basic usage of SourceTree

Image Modified

[-]

...

 To switch between branches double-click the required branch. If you don't see it under the BRANCHES section it means you have not checked it out from the server. For this expand the origin under REMOTES, find the needed branch and double-click

...

it to check it out locally.

Note

The branch in bold is the active branch. When switching to another branch it changes the code in all the folders accordingly. I.e. if you are using symbolic links - code of your system is changed at that point already.

 [-]  To refresh repository status (i.e. see if there are any changes) click on the Fetch button (this will not update files on local machine yet)

        Image Modified 

Tip

...

Usually first checkbox is selected, which means update the status of

...

all repository's branches.

[-] Use the

...

Pull

...

 button to download the changes from repository to the local

...

branch (selected in the step 7)
        Image Modified

...

  

Warning
Use 2 first checkboxes when Pulling changes from repository. 

Creating an archive

In the case when you need to create an archive of repository for instance to be send to another party, please do the following:

...

  • Open the SourceTree program

...

  • Select needed repository which needs to be archived

...

  • In the top menu select

...

  • Repository -> Archive...

...

...


Image Modified

...

  • Press the "..." button and please select location and the name of the archive.

...

Image Modified

...

  • You can find the repository's archive under location you have been specified.