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:

186 questions
629
votes
17 answers

How to convert a normal Git repository to a bare one?

How can I convert a 'normal' Git repository to a bare one? The main difference seems to be: in the normal Git repository, you have a .git folder inside the repository containing all relevant data and all other files making up your working copy in a…
Boldewyn
  • 75,918
  • 43
  • 139
  • 205
232
votes
11 answers

What's the -practical- difference between a Bare and non-Bare repository?

I've been reading about the bare and non-bare / default repositores in Git. I haven't been able to understand quite well (theoretically) about the differences between them, and why I should "push" to a bare repository. Here's the deal: Currently,…
AeroCross
  • 3,504
  • 2
  • 20
  • 29
112
votes
7 answers

Writing a git post-receive hook to deal with a specific branch

Here's my current hook in a bare repo that lives in the company's server: git push origin master This hooks pushes to Assembla. What i need is to push only one branch (master, ideally) when someone pushes changes to that branch on our server, and…
Jorge Guberte
  • 8,064
  • 8
  • 33
  • 51
96
votes
4 answers

How can I uncommit the last commit in a git bare repository?

Taking into consideration that there are several git commands that make no sense in a bare repository (because bare repositories don't use indexes and do not have a working directory), git reset --hard HEAD^ is not a solution to uncommit the last…
81
votes
8 answers

How do I convert a bare git repository into a normal one (in-place)?

I have a bare git repository, but need to access and browse its contents over ssh (in a file manager like user experience). I assume I could clone it: git clone -l However, my repository is about 20GB in size…
nyi
  • 1,156
  • 1
  • 10
  • 17
52
votes
4 answers

How do I create a master branch in a bare Git repository?

(All done in poshgit on Windows 8): git init --bare test-repo.git cd test-repo.git (Folder is created with git-ish files and folders inside) git status fatal: This operation must be run in a work tree (Okay, so I can't use git status with a bare…
David
  • 14,678
  • 20
  • 80
  • 145
41
votes
1 answer

git ls-files in bare repository

I want to access a bare git repository, and I want to list all files in the repository. On a normal git repository I can easily do that by running git ls-files. Example output: $ git…
Jesper Rønn-Jensen
  • 91,561
  • 40
  • 112
  • 147
40
votes
7 answers

Getting a working copy of a bare repository

I have a server on which I have a bare repository for pushing. However, my server needs to have a working copy of the master branch. How do I get a working copy and that only from a bare repository?
Jonathan Allard
  • 16,498
  • 10
  • 52
  • 72
32
votes
4 answers

Git, How to change a bare to a shared repo?

So this is how I set up my project: git init --bare Later I learned that if you want to work on a project with multiple users this is how I should have done it: git init --bare --shared Now I tried to work like that and luckily we are in the…
bottleboot
  • 1,631
  • 2
  • 24
  • 39
29
votes
3 answers

When creating a git repository that will be on the server, can I convert it to a bare repository?

I already created a repository. Can I make it a bare type or shall I start over?
mrblah
  • 88,033
  • 134
  • 292
  • 404
25
votes
6 answers

How can I use git-archive to include submodules from a bare repository

I'm in the process of setting up a deployment script. The basic process is: Push changes to a bare repository on the server Then based on new tags will create a new folder for the release. Use git archive to move the files into the release…
Jacob
  • 7,963
  • 1
  • 21
  • 28
24
votes
3 answers

Git submodule on remote bare

I've setup my environment so I can push to a remote bare repository. I used these commands to set up the remote repository: $ mkdir ~/website.git && cd ~/website.git $ git init --bare And $ cat >…
Thiago Belem
  • 7,524
  • 4
  • 40
  • 64
21
votes
5 answers

can't clone git repos via http; info/refs not found

I am trying to make a git repository available for read-only access over http. I am doing it the old-style way because git-http-backend is not available on my host system. That is, I am simply putting the bare repository in a http accessible…
epl
  • 570
  • 1
  • 3
  • 15
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
  • 188,173
  • 57
  • 343
  • 523
19
votes
2 answers

What is a bare repository and why would I need one?

This maybe has been answered, but I didn't find a good answer. I come from centralized repositories, such as SVN, where usually you only perform checkouts, updates, commits, reverts, merges and not much more. Git is driving me crazy. There are tons…
Albert
  • 995
  • 12
  • 25
1
2 3
12 13