22.10.2019
Posted by 

Atlassian Sourcetree is a powerful Git and Mercurial desktop client for developers using Mac or Windows. Say goodbye to the command line and use the full capabilities of Git and Hg through Sourcetree’s beautifully simple interface.

  1. Atlassian Git Sourcetree
  2. Sourcetree Git Client
  3. Download Git For Sourcetree

Hi folks, Work has forced me to (finally) use Git. I was trying to avoid it because I've been told, like making critical mistakes while hang gliding, it's powerful but unforgiving. Adam and others have said they had similar concerns, but were convinced once they got to know it. I won't go that far in estimating my own experience, but I'm open to using it of course.

I was going to use TortoiseGit because I've used TortoiseSvn and TortoiseHg. I understand TortoiseGit is a direct port from TortoiseSvn, so it should do well. I am a known fanatical advocate of the Graphical User Interface (GUI) and deeply critical of systems that rely solely on the command line interface (CLI). CLIs do have their uses such as scripting for automation (I use scripts for daily backups of this site) and some things that are currently not available through a GUI, but I think they're generally for the elite who unconsciously or consciously wish to keep regular people from easily using and learning their arcane craft and the secret handshake. Why be forced to repeatedly learn a large amount of CLI arcanery when you can do it intuitively in a GUI.

CLIs are a step backward, like nostalgia for the 1950s. They make technology inaccessible to the growing crowd and market of newcomers and casual developers. But I digress. SOME people will tell you I am deeply misguided about CLIs, but those people are part of the elite and have a conflict of interest. Anyway, all this is to say that Atlassian recently released SourceTree for Windows, a GUI Git and Mercurial interface.

Atlassian Git Sourcetree

It was available only for Macs, but it is now available for Windows too. This is great news because SourceTree was very popular as a Mac repo GUI solution. I'll probably try it along with Tortoise, but if anyone has experience with SourceTree, I'd like to hear about it. Being yet another quality Atlassian tool, so much the better.

Good to know that it now exists for Windows too, I hadn’t heard of that. I’ve been using SourceTree since I first heard of it when it became free (which I think was when it was acquired by Atlassian) and I’m very happy with it. It has become my main Git GUI (with only occasional side trips to gitk) and occasional Mercurial GUI (it hasn’t fully pried me away from MacHg yet). I don’t recommend using Git without a GUI for that matter, because its command-line interface is horrible.

Combine GUI and CLI to make use of the strenghts of either. (GUI-only doesn’t work for me either, as there are things that are either more awkward in a GUI than on a command line, or are simply not exposed by the GUIs I use – but opinions and requirements may differ here.) There are two essential GUI parts to any DVCS in my opinion, a diff viewer and a revision tree viewer, but it goes further with Git. For instance, the staging area (index) is a novel concept for Git newbies, and the natural instinct is to ignore it or make it go away, because using it via the command line is awkward. Only using it in SourceTree made me aware of its real value. Don’t let the horrible command-line interface, on the other hand, discourage you from trying Git at all – I made that mistake too at first.

Git is an extremely capable and (apart from the command-line user interface) very well designed tool. It has a learning curve – unlike other VCSes, you are expected to understand the basics of how Git works internally in order to be able to use it efficiently – but also unlike other VCSes, these inner workings are very clean and simple. I found the a big help. It seems important to me to use a GUI that embraces the way Git works rather than trying to gloss it over. SourceTree seems to be doing pretty well in that regard, although I don’t have much experience with others to compare.

Formidable

GitHub for Mac and GitBox on the other hand seemed too simplified for me. Hi folks, SourceTree is out of beta at version 1.0.2, now supporting Mercurial in addition to Git. I've been using it every day and it's far superior to any of the Tortoise products I've used. It makes repository use accessible to everyone through a Graphical User Interface. That's a good thing because it lowers the barrier against casual developers who are otherwise discouraged by arcane command lines, allowing them to join the software development community in a larger capacity. The command line is still available for those who prefer it or have an occasional use for it.

In my continuing (subjective) zeal to promote intuitive and productive GUIs (Graphical User Interfaces) over arcane and laborious CLIs (Command Line Interfaces), there are a few cool things to note in the Windows SourceTree update today with version 1.4.0. In some misguided sympathy for CLI fans, It even includes some more functionality there: Here are the new features I think are most interesting, most notable git-svn and patches, but the full list is here:.

git-svn support - you can now clone from Subversion repositories to local git repos and interoperate with them via push / pull. Command line interface - you can now call SourceTree.exe on the command line to open SourceTree for your current repo (or a specified one). You can also pass additional commands to it (use -help) to do specific things. Translations - several languages are now supported and you can help refine this via the SourceTree translation project.

Patches - you can now create and apply patch files in SourceTree, see the Actions menu.

Adding all the content files for the first time Welcome to your tutorial repository! Learn how to use Git and Bitbucket with either SourceTree, one of the best Git clients available, or using Git from the command line. Whichever you choose you will learn how set up Git, clone this repository locally. Then learn how to make and commit a change locally and push that change back to Bitbucket. Start here Choose either SourceTree, Atlassian's Git client, or the command line to learn source control using Bitbucket and Git. Use for Windows and Mac Use for Windows, Mac, and Linux Finally, if you want a complete end to end tutorial: See our.

Collaboration is the core of Git Unlike SVN, Git makes no distinction between the working copy and the central repository—they are all full-fledged Git repositories. Git's ability to communicate with remote repositories is the foundation of every Git-based collaboration workflow. To learn more about Git and Git workflows see,. SourceTree Download, install and configure SourceTree. Source tree is Atlassian's Git GUI client and one of the most popular on the market.

This section contains the following tasks:.: Download, install, and configure SourceTree.: Learn how to clone the bucket-o-sand to your local system. Install and configure SourceTree. Go to and click Download SourceTree Free. Open the downloaded file and click Run. Accept the default settings by clicking Next at each screen. (Windows only: Follow the instructions for installing.Net Framework if prompted.). Select a location to install SourceTree or accept the default.

Click Finish (Mac) or Install (Windows). The SourceTree welcome wizard opens. Select I agree to the license agreement and click Continue. Now you have SourceTree installed!

Next you'll complete SourceTree configuration. Configure SourceTree. SourceTree will install Git, if you do not already have a version installed. The welcome wizard will help you add an account. Select Bitbucket in the Account A section, and enter the same login information you use for your Bitbucket account in the Username and Password fields B.

Click No to decline SSH keys for the moment. If you have SSH keys you can add them later. Finally, you can in the next section. Clone repository locally Next we'll get the repository to your local system. The git clone copies an existing Git repository as its own full-fledged Git repository.

Cloning also creates a remote connection called origin pointing back to the original repository. Clone from SourceTree welcome wizard If your installing SourceTree you can clone your repository during the configuration process. Select your repository 1 from the list in the welcome wizard. Confirm the destination folder 2, or select a new one. Now you have a clone of the repository on your local system and are ready to work. Next, you can Clone from Bitbucket Learn how to clone a repository starting from Bitbucket to your local system using SourceTree. Open the sidebar navigation by clicking on the symbol.

Git

Click Clone A, then click Clone in SourceTree B. NOTE For Mac you will be asked to launch an application, click OK to continue. This will prompt SourceTree to open the clone dialog, as shown in the following example:. Microsoft Windows A. Macintosh B Check the destination path and modify it if you wish to place your repository file in a different directory.

You might want to create a directory specifically for your repositories: /repositories/bucket-o-sand Inspect your repository Let's take a look around your repository in both Bitbucket and SourceTree. Repository in SourceTree The files and titles in your repository might be a bit different, but the basics are the same. 1 Repository bookmarks: displays a list of all the repositories you have listed.

You can double click a bookmarked repository to open it in an active tab. 2 Active repository tab: you can have many repositories open at once, each tab lets you view a different repository.

Sourcetree Git Client

In this example working copy is selected, so in the next pane you can see a list of the files in the working copy of this repository. 3 View selection: in this pane working copy you can choose to view only the files in a particular state (such as: All, Modified, Clean). 4 Working copy and Staged changes: here you can see the files in the active view (based on the selection in 3) and drag changed files from working into staged to create a change set to commit. 5 Currently selected file: you can see the diff view of a selected file in the working copy or staged area. Repository in Bitbucket Your repository will have some differences but, again, the basics are the same. The view in the following example has the sidebar expanded press to expand the sidebar. A Actions: all the most common actions are here, create a clone, branch, pull request, etc.

B Navigation: this is where you can get to all the things in Bitbucket (such as: source code, list of commits, list of branches). C README: The view in the preceding example is on the Overview page where you can configure your own README using markdown or plain text. D Recent activity: lists the most recent commits, pushes, merges, and pull request activity. Make a commit and push a change Now your ready to make a change, add that change to your local repository, and push the change to your remote Bitbucket repository. Open a file from SourceTree A simple thing like selecting and opening a file from the source control UI can make things move quicker. Select All from view selection menu.

Select the 'sample.html' file, then right click and select Show in Explorer (Windows). Then select Show in Finder (Mac). Using your favorite editor, edit the sample.html file. Change the heading from My First File to Playing in the Sand.

Save and close the file. Commit the change in SourceTree Now you've made a change locally and are ready to go through the git process of adding that change to the project history locally. The 'git add' moves changes from the working directory to the staging area.

This gives you the opportunity to prepare a set of changes (a snapshot) before committing it to the official history. The git commit takes the staged snapshot and commits it to the project history.

Combined with git add, this defines the basic workflow for all Git users. Let's do that in SourceTree. Identify the changed file A in SourceTree by noting the change in color and from a checkmark to an ellipsis, as shown in the following example.

Click and drag the sample.html A that file to the Staged files B area. This action is the same as the 'git add' or 'git stage' command. Click Commit from the in SourceTree. Add a commit message C, then click Commit. Now the snapshot of your change has been added to your local project history. Push the change to Bitbucket The last thing we'll do is push that change to Bitbucket.

Click Push from the toolbar. You'll notice there is a 1 highlighted in the Push action. This is the number of commits ready to be pushed to the remote repository, Bitbucket in this case. The push dialog opens. Review the settings and click Ok.

Download Git For Sourcetree

Pushing lets you move a local branch or series of commits to another repository, which serves as a convenient way to publish contributions. This is like svn commit, but it sends a series of commits instead of a single changeset. You've done all the basics! Feel free to use the tutorial repository to learn more, test, experiment, and expand your knowledge.

You can jump into the after the Clone your repository section. Or you can check out and learn more about Git workflows.

All of us at Bitbucket and SourceTree hope your experience is a great one! We are constantly working and building a better Bitbucket and SourceTree. Command line Learn the very basics of cloning, committing, and pushing from the command line. Git is a very effective from the command line and it's commands are reasonably easy to learn. If you don't already have Git installed on your local system see, then return here.This section contains the following tasks:. If you are unfamiliar with the Git, or the Git commands here are a couple very good resources:.: Nice crisp PDF of all the basic Git commands.

Clone your repository: Cloning makes a local copy of the repository for you. Click Clone in Bitbucket A, as shown in the previous figure. Make sure the protocol B is set to HTTPS, as shown in the previous figure.

Bitbucket pre-fills the clone command for you. Copy the command C. Open a terminal, or launch a GitBash terminal, on your local machine. Navigate to the directory where you want your files. Use the cd /path-to-your/directory command to navigate to the location you want your repository.

Paste the command C you copied in step 3 at the prompt. Press ENTER on your keyboard.

The result should be something like. Git clones your repository from Bitbucket to your local machine. If you have trouble cloning from these instructions you can check out the more. The git clone command copies an existing Git repository as its own full-fledged Git repository with its own history, manages its own files, and is a completely isolated environment from the original repository. Cloning also creates a remote connection called origin pointing back to the original repository Make a commit and push the change Learn the Git basics of stage, commit, push when you make a change to the 'sample.html' file. Navigate to the directory (folder) where you cloned your repository.

Using your favorite editor, open the sample.html file. Change the heading from My First File to Playing in the Sand.

Save and close the file. Navigate to the repository in your command line 'cd path/to/your-repository'. Stage the file with Git. Git add sample.html. Commit the change.

Git commit -m 'changing sample.html'. Push to Bitbucket. Git push The system prompts you for a username/password. Enter your Bitbucket account name and the password. After the push completes, click Commits, in Bitbucket, to view your change.

The 'git add' moves changes from the working directory to the staging area. This gives you the opportunity to prepare a set of changes (a snapshot) before committing it to the official history.

The git commit takes the staged snapshot and commits it to the project history. Combined with git add, this defines the basic workflow for all Git users. Pushing lets you move a local branch or series of commits to another repository, which serves as a convenient way to publish contributions. This is like svn commit, but it sends a series of commits instead of a single changeset.

You've done all the basics! Feel free to use the tutorial repository to learn more, test, experiment, and expand your knowledge. You can jump into the after the Clone your repository section. Or you can check out and learn more about Git workflows. All of us at Bitbucket and SourceTree hope your experience is a great one! We are constantly working and building a better Bitbucket and SourceTree.