Questions tagged [git-bare]

A bare git repository is so named because it has no working directory; it only contains files that are normally hidden away in the .git subdirectory. In other words, it maintains the history of a project, and never holds a snapshot of any given version.

From Git Magic, Chapter 3:

A bare repository is so named because it has no working directory; it only contains files that are normally hidden away in the .git subdirectory. In other words, it maintains the history of a project, and never holds a snapshot of any given version.

A bare repository plays a role similar to that of the main server in a centralized version control system: the home of your project. Developers clone your project from it, and push the latest official changes to it. Typically it resides on a server that does little else but disseminate data. Development occurs in the clones, so the home repository can do without a working directory.

Converting:

197 questions
20
votes
1 answer

What's the most straightforward way to clone an empty, *bare* git repository?

I've just finished cruising the Google search results that contain all the email rants about how stupid it is that git can't clone an empty repository. Some kind soul even submitted a patch. Until git is upgraded, what is the simplest, most…
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
16
votes
3 answers

git merging branches in a bare repository

I would like to create the following setup for my git repos: I currently have a local git repo with all my working files. I would like to be able to setup a central bare repository, and two other non-bare repositories -- one for a live application…
user480029
  • 421
  • 1
  • 3
  • 13
15
votes
2 answers

How to view files in bare repositories?

I have a bare repository in my remote. I want to look at files, that is open in an editor and view the code. For listing files, git ls-files master or git ls-tree master. and for viewing single file, I could do git show 100644 But how do I view…
brain storm
  • 30,124
  • 69
  • 225
  • 393
14
votes
2 answers

Git - Bare repo cannot have a worktree for master branch - WHY?

I'm working on some server-side software to do a merge. By using git worktree it's possible to check out a given branch for a bare repo and merge another branch into it. It's very fast, even with large repositories. The only exception seems to be…
mtutty
  • 815
  • 2
  • 10
  • 22
12
votes
2 answers

Git - did init bare in wrong directory

I ran the git --bare init in a wrong directory(in the server). I see the files branches, config, deps etc., in that directory.. How do I undo it?
500865
  • 6,920
  • 7
  • 44
  • 87
11
votes
2 answers

How to git clone from *local bare* repository

Say I have a bare repository on my local machine at ./new-bare.git. What is the correct way to clone it to another location on my machine?
Omer Dagan
  • 14,868
  • 16
  • 44
  • 60
10
votes
2 answers

GUI for bare git repo

Is there a GUI for a bare git repo directory ( there is no working tree anywhere ) that I can: Check logs See the whole working tree structure for any commits Regarding to why I need this: My git is init as this: git --git-dir=xx --work-tree=yy…
Tom Fishman
  • 1,716
  • 6
  • 22
  • 36
10
votes
1 answer

"fetch --all" in a git bare repository doesn't synchronize local branches to the remote ones

I'm trying to synchronize periodically a git bare repository, my local branches are created using the "--track" option. here is my config (without unnecessary things): [core] bare = true [remote "origin"] url =…
gburri
  • 154
  • 1
  • 2
  • 9
10
votes
4 answers

git bare repositories, worktrees and tracking branches

I'm working with a code base where I need to be working on several branches at once for different purposes. So I clone to a bare repository and then set up some worktrees: git clone --bare ssh://git@git.example.com/project/repo repo.git cd…
Tom
  • 7,269
  • 1
  • 42
  • 69
9
votes
1 answer

concept of bare shared repository in git

I have been facing difficulty in understanding the bare repository . I have read everywhere that a shared repo is a bare repo. Why must it be a bare repo? Can't it be a normal repo which collaborators clone and then push/pull?
user2636464
  • 685
  • 7
  • 17
8
votes
3 answers

Git bare - what to backup?

I'm sorry if this is covered elsewhere, but I can't find the answer. I have a bare repo, called bare.git which is the repository from which are cloned the dev repos. It all works well. I want to know where bare.git gets the source files from. Are…
Leo
  • 6,553
  • 2
  • 29
  • 48
8
votes
1 answer

Does git allow for "bare" submodules?

This may be terrible, I am not sure. Let us say we have a repo "product" with a working directory /product /product/command.script /product/config/ (bare git repo) And a repo "config" with a working directory /config /config/config.json The…
Tyler Clendenin
  • 1,459
  • 1
  • 12
  • 25
8
votes
1 answer

When to use a bare Git repository?

What are some use cases for a bare Git repository? When should we prefer to use a bare repository and what benefits it gives us? If I need a repository for sharing with a team and pulling changes from production server should I use a bare Git…
Sonique
  • 6,670
  • 6
  • 41
  • 60
8
votes
1 answer

Executing git commands on a bare repository

On my server, I host some bare git repositories that I'm working on. I'd like to display some basic statistics about each repository on my website; for now, let's just say I want to do simple stuff like listing all the files in the repository. On…
Josh Buell
  • 606
  • 5
  • 12
7
votes
1 answer

Does git log --branch have a different behaviour on normal and bare repositories?

I'd like to use the git log command to extract the list of changes from a repository since a given date on a specified branch. For the purpose I found the following syntax which seems to work fine: git log --since=2011-10-01 --branches=mybranch The…
1
2
3
13 14