Sourcetree Path

Can't find node in PATH Can't find npx in PATH Basically the issue is that /usr/local/bin is not in the PATH list. This is really disheartening (making us doubt the reliability of SourceTree). SourceTree will probably populate the “Name” box with whatever the final folder of “Destination Path” is. For example, it switched it from “testprivaterepo” to “VeryCoolRepositoryNumber1” on me as soon as I hit “tab” from setting up the path on my hard drive where I wanted to store a local copy of my GitHub content. I had the same issue and it is also solved for me by ensuring that the remote/origin uses a mapped drive letter rather than UNC. This is not a SourceTree issue as the same thing happens with Git Bash for Windows, and the same solution applies. The local repository can always use a UNC path just fine. – Jason May 16 '18 at 20:25.

(Note: These are the steps for a Windows installation of SourceTree. Not sure if there are differences for a Mac installation.)

Generate/Load SSH Keys:

1. Open SourceTree.

2. Pick “Create or Import SSH Keys” under “Tools” tab.

Sourcetree path too long

3. Keep default settings on new window and select “Generate” and follow instructions to generate SSH key pair.

4. Save both the public and private key.

5. Open your system tray and select Pageant (the icon of a computer wearing a fedora).

6. Click “Add Key” and select the private key you generated.

7. If the repository you want to clone is on an online hosting service, then copy public key and add to your site profile.

Clone Repository:

1. Pick “Clone / New” under “File” tab.

2. Copy SSH clone URL from repository to the line “Source Path / URL”.

3. Select desired Destination Path and Name.

4. Click “Clone”.

5. You’re done! The repo may take a while to clone, so a bit of patience is required.

SourceTree General Setup¶

Prerequisites¶

In order to use SourceTree in Windows PuTTY should be installed and your SSH key loaded into pageant(see Create SSH key on Microsoft Windows).

Installation¶

Sourcetree
  1. Download SourceTree at https://www.atlassian.com/software/sourcetree
  2. Execute the installer

Basic Settings¶

First of all set the basic settings for your Git configuration by clicking on the settings button in SourceTree andadd your name, email and SSH Key. Make sure the option “SSH Client” is set to PuTTY/Plink.

Path

Clone¶

To clone a new repository click on “Clone/New”.

Enter the URL to your repository and the path to your local folder. For easier access to your repositoriesleave the bookmark check box checked.

Click on Clone. Checking out the full TYPO3 Core repository might take some time, please be patient.

Automatic links to Forge and Gerrit¶

The commit messages contain a reference to the corresponding Forge ticket and a Gerrit review link. To get directlinks from SourceTree choose the Core repository bookmark on the left and then click on the Settings button in thetop bar. Choose tab “Advanced” and click “Add” at the section for “Commit text links”:

Choose “Replacement type:” “Other” and add

  • Regex pattern: (#)+((?:[0-9]*)?)
  • Link to URL: https://forge.typo3.org/issues/$2

Repeat the steps for the Gerrit links and add

  • Regex pattern: (https://review.typo3.org/.*)
  • Link to URL: $1

After adding these two settings your commit history now shows links:

Reviewing and testing patches¶

Update the repository¶

Before applying a patch you should update the repository to its latest state. Press the pull button from the main buttonbar:

Then click OK:

Cherry-picking¶

First visit the page of the patch in Gerrit. From the Download menu, choose the copy button after the ‘Cherry Pick’ line.

The next step has to be done via the command line. Open git bash by pressing “Terminal” and paste the copied line withthe ‘Ins’ button:

The patch is now applied and you can start testing.

Creating patches¶

Commit hook¶

In each folder that contains a repository you need to execute the following command to install a Git hook which adds a uniqueChange-Id to the commit message (and performs a few checks). Choose the repository from your bookmarks and click “Terminal”to open a git bash for that repository. Copy the following command to the bash and execute it:

Jiffy lube wheel alignment. Note

You can read about the why and where of the pre-commit hook here.

Setup for pushing to Gerrit¶

In the Git Bash window (click Terminal), enter the following commands to set that you push to Gerrit instead of the TYPO3 repository directly.

Sourcetree Change Path Local Repository

Create a branch¶

It’s easier to undo all the changes in a patch if you create a branch for it. Click on the branch button and entera name for your new branch, then click “Create Branch”.

Now start coding and commit your changes (By pressing the “Commit” button). Make sure your commit message is writtenaccording to the >>>rules for the commit message<<< and click OK.

Your changes are now stored locally in a separate branch.

Send the patch to Gerrit¶

Click the “Push” button to open the push dialog.

Check the checkbox in front of your feature branch. As remote branch add “refs/for/master” - which will create a new patchsetfor master. If you want to create patches for older branches use ‘refs/for/<branchName>’, for example ‘refs/for/TYPO3_6-2’.Be aware that you have to fix a bug in master first before it can go to older branches.

Now click ok. You should get a Gerrit link to your new change in the resulting output.

Cleaning up¶

Sourcetree Embedded Git Path

To get back to master just click on it at the “Branches” section. If you want to delete your feature branch,right click on it and choose “Delete”.