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

how to open/view a shared (bare) git repository w/ SourceTree?

Ian Scott-Fleming April 28, 2012

Am a noob to both Git and SourceTree.

We wish to use Git with shared repositories, created with:

mkdir shared_repo
cd shared_repo
git --bare init --shared
git --bare fetch myrepo master:master # import myrepo into shared_repo

then push/pull changes from shared_repo. ( Bare repos don't have a working tree, and so do not have a .git folder; all subfolders of the .git of a normal git repo are in main folder of repo init'd with --bare.)

But when I try to do a file | open on shared_repo in SourceTree, I get the msg "Invalid folder: the path ... does not refer to a working copy for Mercurial, Git or Subversion".

I can open and view shared_repo with gitk, and it appears to be a valid Git repo.

I can clone shared_repo and open the clone with no problem.

The question is, can I use SourceTree to open, view (and possibly modify) shared_repo , or can SourceTree only work with standard git repo's that have a working tree and a .git subfolder?

4 answers

1 accepted

0 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2012

SourceTree can't open bare repositories directly, it's a client tool for developers primarily. You can of course use bare repositories as remotes (that's what 99% of remotes are after all), all you need is an access path to them, which can be a file path or a URL. Just clone from them to create a local non-bare clone. You then modify the remote bare repo by pushing new changes to it as normal.

Ian Scott-Fleming April 29, 2012

OK, thanks. Sort of what I figured. just wanted to be sure I wasn't missing something obvious. The other tools I tried had no problems with opening bare repos.

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2012

In practice 90% of SourceTree's functionality is useless on a bare repo (the only thing you can do is view/search the log), I have a feature request logged for it but it's low priority because of this, and the fact that no-one's asked for it (until now!).

Eric Anderson October 2, 2014

Creating a local non-bare clone doesn't work if you want to use the repository as a shared repository for use with git-subtree. To be usable, the local copy needs to be bare. That makes it valuable to be able to work with it in all the same ways that one would work with the bare repositories at BitBucket (e.g. commit graphs, code viewing, differences, etc.) -- all without network access. Plus one would like to be able to push/pull between the local copy and the BitBucket copy while one does have internet access.

0 votes
bucketfist May 31, 2013

I don't seem to have permission to view that issue. The link doesn't work. I get "Permission Violation. It seems that you have tried to perform an operation which you are not permitted to perform. If you think this message is wrong, please contact your JIRA administrators."

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 2, 2013

Not sure why that was private, I've made it public.

0 votes
bucketfist May 31, 2013

Other similar links, such as https://jira.atlassian.com/browse/SRCTREE-697 do work.

https://jira.atlassian.com/browse/SRCTREE-69 however, does not.

0 votes
bucketfist May 30, 2013

I'm in Jira right now and I can't find the feature request for the ability to view the log of a bare repository. I would like to vote that issue up. Do you have a link? Thanks.

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 30, 2013

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events