Newbie needs advice on refreshing repository on disk.

I have used just about every sccs from rccs through svn, but this is my first time using git, stash, and SourceTree. I have downloaded a repository to my desktop successfully, but have no idea how to refresh it. Trying Clone / New brings up a dialog box with prompts that may be clear as gin to experienced users, but I have no clue (and no manual - what's up with that) that tells me what goes in each text field, particularly 'Source Path / URL:' and Destination Path. I tried the same remote source and desktop folder that the current repository resides in, but got an error message saying that the directory already exists and is not empty. All I want to do is refresh my existing desktop repository with the updated original in git.

3 answers

For every newbie, I recommend reading portions of the Git Book. Focus on sections 1.1-1.3, and chapters 2-3.

For starters, it is unclear what you mean by "I downloaded a repository". This is not a typical step when setting up a Git repository. To find out whether what you doesnloaded was actually an entire repository, or just a copy of the latest versions of the files, find out whether you have a .git directory in the root folder (will be a hidden folder). If you do, you'll want to skip the "clone" stage, and instead "Add Working Copy". If there is NOT a .git folder, you won't want to use this download as the basis of your repository.

The Stash UI should provide a "Clone in SourceTree" button. Click that, and it should launch SourceTree with the appropriate URL pre-populated. You'll need to choose the destination path for the repository (where you want your local copy to reside).

Once you have a repo set up in SourceTree, understanding the UI is dependent on understanding Git. The terminology is identical in nearly every instance.

John,

If you made changes, consider first creating a branch or "Stash save" so you don't lose your work.

Clone will basically re-create the repo. Since you already have that, it's not what you probably want.

You most likely want either git "pull" or fetch", depending on what you want done to the code.

May I suggest this simple guide, and in particular the section on "replace local changes" which might help.

Note that you'll only be able to Stash changes if SourceTree recognizes the folder as a repository.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Rachel Wright
Published yesterday in Training & Certification

How to Extend your Jira Administrator Certification

...; didn’t   know about Jira email!  For example, did you know Jira will try to send a notification message 10 times?  I didn’t!  As soon as I learned that, I searched for any active...

87 views 2 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you