A distributed revision control system
Source code management system for software development.
Maintaining versions of applications when these have a large number of source files.
SourceTree is a free Git Client that provides a graphical interface for Git repositories.
Once your changes are staged, you can Commit:
The main SourceTree Log/Historyscreen now lists your new commit:
Fix your merge conflicts and commit before doing anything else
Once your conflict is resolved, don't forget to commit right away!
Note how the Log/History view now shows your merge commit:
Before doing a Push it's important to Fetch (or Pull, see below) so that we get the latest updates from the server and merge them in with our local changes.
We can leave the experimental branch as local-only. When you confirm the dialog, your new branch is created on Github, the commits are pushed and the result is the following:
In TFS (or SVN), when you "Get Latest..." (or "Update") you risk generating conflicts with your current working copy.
In Git, when you Fetch from all your remotes, it is a much safer operation. All that will happen is that your local copy of the remotes' branches will be updated. It is then up to you to merge any new commits from the remote branches into your local branches.
Let's continue with our example. Assume that, prior to our initial Push, we had cloned the original repo on another PC (referred to henceforth as PC2). In PC2's local repo the Log / History view looks like this (assuming gitflow was initialized):
The result is that your local copy of the remote branches is updated, as shown here:
To be on the safe side, try to always use Fetch before using Pull, so that you get a chance to visualize how difficult the remote-to-local merges will be.
If you decide to Pull, SourceTree will ask you which remote branch to merge into develop. Chooseorigin/develop:
Your local develop branch is now up-to-date with the version on Github.