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
6
votes
1 answer

How to create reflogs information in an existing bare repository

As you might have known that by default, git doesn't enable reflog updates for new bare repositories. The problem is, I have a long history repository but it was created before I set the flag "logAllRefUpdates" on, and now I want that information…
instcode
  • 1,495
  • 14
  • 16
6
votes
1 answer

Getting 'receive.denyCurrentBranch' error when pushing to bare Git repo

Have a remote git bare repo that onto which I've pushed a branch from one machine, and pulled to another machine. Made some changes on the other machine, trying to push those changes back to the remote bare repo, and I get the…
rickb
  • 601
  • 5
  • 19
6
votes
2 answers

npm install from bare git file repo

how can I install an npm module from a bare git repo folder? So I have a folder that contains a git repo. It was created with git init --bare. Now I want npm to fetch the latest version of the master branch, and there a package.json file is…
Lux
  • 17,835
  • 5
  • 43
  • 73
6
votes
4 answers

When pushing branches and tags, get error: cannot spawn git: no such file or directory

I have an existing, bare, Git repository created from importing our source and history from CVS. I make a mirror, using: git clone --mirror git://aserver.adomain.com/myrepo Then, I want to push all branches and tags to our internal Git repo host,…
kevinmm
  • 3,136
  • 4
  • 21
  • 24
5
votes
3 answers

What are the purpose of the bare git repositories in .repo/projects/ created by the Android repo script?

The Android source is managed by repo. When syncing using repo, a directory called .repo/projects/ is created, which contains all the git repositories also checked out directly in the current working directory, just in bare git format. For what…
Bjarke Freund-Hansen
  • 28,728
  • 25
  • 92
  • 135
5
votes
1 answer

Adding things to a git bare repository

I know that if I have files in a bare repository, I can access them using git show HEAD:path/to/file. But can I add new content to a bare repository without cloning and modifying a working tree?
Tom J Nowell
  • 9,588
  • 17
  • 63
  • 91
5
votes
1 answer

Why can’t you merge in a bare git repo?

Why can’t I merge into a bare repo? Bare repos don’t have a HEAD or a working tree. In the config file we can see bare=true. You also can’t pull in a bare repo (because pull = fetch & merge and merge doesn't work). However, you can push to a bare…
5
votes
2 answers

Is there a git activity log?

Something went really wrong here. Allow me to give the background. Today I try to push to our company default bare msysgit windows server and get a dreaded error message duplicated everywhere in SO about pushing to non-bare. I thought the message…
cregox
  • 17,674
  • 15
  • 85
  • 116
5
votes
2 answers

Bare repository permissions.

I setup git on an ubuntu server and I was pushing the local repo to the server and getting the errors below. When I change the permissions of the two folders it works. I just want to understand why when I setup git init --bare it doesn't just work…
ThomasReggi
  • 55,053
  • 85
  • 237
  • 424
4
votes
1 answer

Git: How to check which files exist (and their content) in a shared (bare) repository?

I created a shared repo by: git init --bare my_project.git At some point, another user updated this repo with his changes (using git push). How could I check which files are exist now in the shared repo and what is their content ? In a local repo,…
Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746
4
votes
2 answers

git add remote tracking branch to bare repo

I have a bare repo that was cloned from git.drupal.org. I have cloned from this bare repo to various different websites. From each of these, I push a site-specific branch onto the bare repo. E.g. if I have foo.org and bar.org, then my bare repo…
artfulrobot
  • 20,637
  • 11
  • 55
  • 81
4
votes
2 answers

How to use vim-fugitive with a git bare repository?

Environment Setup I use a git bare repository to version my config files. I can use same commands as if I were using a normal git repository just have to include some flags: git --git-dir=/home/kunzaatko/.cfg/ --work-tree=/home/kunzaatko/…
kunzaatko
  • 51
  • 4
4
votes
2 answers

Why can't I push to a checked out branch of a non-bare repository?

I am confused regarding a scenario that I created. I created a repository on Github (Lets call it A) and pushed code to it. After that I cloned that repository to my local (Lets call it B) such that origin of my local was remote repo A. Now I cloned…
harsrawa
  • 422
  • 5
  • 18
4
votes
1 answer

Ansible: how to init git bare repository and clone it to the same machine?

I would like to ask you how it is possible to implement such a case using Ansible. My main goal is to nit git bare repository and clone it to the same machine (/var/www). My usual steps were: 1) git init —bare (running in /git/project-name) 2) git…
Ivar Mahhonin
  • 41
  • 1
  • 2
4
votes
1 answer

Track a branch in a bare git-svn

When I run this command: git --git-dir=firebird.git branch -a This is my output: B1_5_Release B2_0_Release B2_1_Release B2_5_Release * master remotes/B1_5_Release remotes/B2_0_Release remotes/B2_1_Release remotes/B2_5_Release …
1 2
3
13 14