Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,417
Community Members
 
Community Events
184
Community Groups

In Sourcetree, how can I get a copy of a previous version of a file from the remote repository?

I am a newbie.  I just installed the latest version of Sourcetree to be a GUI for Git. .  I do not know much about Git, FYI.  I see in the Git toolbar a Fetch icon.  I looked in the documentation for what Fetch does and did not find anything?  I wondered if Fetch will do the job?  I see a dashed circle around the Fetch icon.  What is the significance of a dashed circle versus a solid circle?  (The remote repository I am working with is https://bitbucket.org/uiprose/alpha_system/src/master/

)

1 answer

1 accepted

0 votes
Answer accepted
minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 18, 2019

Hi
Fetch simply pulls any changes from the remote repository into your local copy, i.e. the .git folder. It will not change your local working copy, hence the dotted circle, to do that you need to Pull.

To view the contents of a remote version of a file in Sourcetree.

In the File Status view select the Show All filelisting option, then find the file of interest. Alternatively use the Search option on the same screen.

Once you can select your required file use the context menu to Log Selected... this will give you a history of the file. 

You can then select the version you want and use the context menu to Open Selected this will create a temporary copy of the file at that revision and open it for you.

I found the following web page to be very useful.  It includes a discussion of:The major difference between Git and any other VCS (version control system) .

https://git-scm.com/book/en/v1/Getting-Started-Git-Basics
Here are some highlights from the above page:

 

The major difference between Git and any other VCS (version control system) (Subversion and friends included) is the way Git thinks about its data.

 

Now, pay attention. This is the main thing to remember about Git if you want the rest of your learning process to go smoothly. Git has three main states that your files can reside in: committed, modified, and staged. Committed means that the data is safely stored in your local database (repository). Modified means that you have changed the file but have not committed it to your database yet. Staged means that you have marked a modified file in its current version to go into your next commit snapshot.

 

This means that Commit does not modify the remote repository by itself, only when you do a Push at the same time or at a later time as a Commit.
I thought that Commit makes your changes visible to other people, but I was wrong.  Push is what accomplishes that.  Pull is what merges other peoples changes into the files you have modified (but not pushed) and what copies the changes others have made to files you have not modified.

The following web page explains more about what commit really does.

https://git-scm.com/book/en/v1/Git-Basics-Recording-Changes-to-the-Repository
The above web page is part of a useful chapter that is introduced here:
https://git-scm.com/book/en/v1/Git-Basics

The following web page explains what push and pull really do.https://git-scm.com/book/en/v1/Git-Basics-Working-with-Remotes

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events