Github & SourceTree Manual - 15831
Github & SourceTree Manual - 15831
SourceTree Overview
SourceTree is a free Git Client for Windows and Mac that provides a graphical interface for your Git
repositories.
SourceTree simplifies how you interact with Git repositories so you can focus on coding. You can
manage all your repositories hosted or local through SourceTree's simple interface.
SourceTree is perfect for newbies. It is very simple for your team. It can bring everyone up to speed
with Git. Commit, push, pull, and merge changes easily with a click of a button. It organizes your repos
with the intuitive bookmarks window. It visualizes how your work changes over time with SourceTree's
log view.
SourceTree is powerful for experts. It makes advanced Git developers even more productive. It reviews
your outgoing and incoming change-sets.
Git-flow out of the box. It uses Git-flow with ease. It keeps your repositories cleaner and your
development more efficient with SourceTree's intuitive interface to Git. It is a consistent development
process, right out of the box.
You can install SourceTree on your machine through this link http://www.sourcetreeapp.com.
Connection
Now, after you have created an account on Github and installed SourceTree on your machine, three
tasks have to be done.
1. Some ssh commands have to be written in the terminal to create a private key. So, open
the terminal and write these commands:
a) To create your public/private key pair and then upload your generated public key
(~/.ssh/id_rsa.pub) to Github, type:
ssh-keygen -t rsa -C "your email address"
b) To allow using SourceTree in the GUC, you have to configure Git's proxy. Remember to
remove it from (~/.gitconfig) when you need non-proxied access, type:
git config --global http.proxy 50.0.0.5:8080
2. Clone the repository to your local machine:
Cloning makes a local copy of the repository for you.
a) On Github, copy the HTTPs clone URL. The system selects the URL for you.
c) Choose Clone in SourceTree. SourceTree starts up and displays the Clone New dialog.
f) That's it; you have cloned your first repository! Keep the repo open and try the next task.
3. Make a change:
Make a change in a source file and push the change back to Github.
1. Press Stage File or drag the file into the staging area. SourceTree moves the file into the staged area.
2. Choose Commit.
3. Enter a commit message to describe what you have changed/added.
4. Press Commit.
5. Now, the Push icon shows you have a single commit ready to push to your repository.
6. Press Push to send your changes to Github.
7. Press OK when prompted.
8. After the push finishes, use the Commits tab on Github to view your change.
9. You can also get the updated/added files that others pushed by pressing Pull.
10.
Some lines will be colored in red (Have been modified), others in green (Have been added) and
others as is with a white background (Nothing changed).
11.
That's it for task 2. You have completed your first commit and push on Github! Now try it with
your own repository.
You can also view your repo from Github. The following window is an example.
If you the README.md file is clicked on, the following window will appear.
If you the Blame button is clicked on, the following window will appear.
This window shows all the commits that have been made to this file with the author, date and
descriptive message. If the History button is clicked on, the following window will appear.
It displays the history of this file with all its versions. If any of them is clicked on, the following window
will appear.
It shows the selected version of the file with its author and date. It displays the lines that have been
added/modified with green/red background. Also, it allows other users to write a comment on this file
for the author to make any changes if any.