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

How can I remove a commit on a branch of a remote bare repository?

Problem Description I have gotten myself into a gitpickle. This image illustrates the situation I've put myself in: Unsurprisingly, I now can't push the green commits, because the non-fast-forward updates are rejected. On the remote, I tried to…
skrrgwasme
  • 9,358
  • 11
  • 54
  • 84
3
votes
3 answers

Shared Git Repository on Windows File Server (Fail)

Before anyone jumps in and refers me to a prior post, let me say, I've gone through all of them with no success. As the title says, I'm trying to setup a shared git repository on a Windows file server using local path (e.g. s:\SharedProjects\foo),…
3
votes
1 answer

Missing commits when cloning from bare remote repo

I have a small PHP library which I have written to support various web projects. Those projects are all in git, and the library is a submodule of each of those repos. The web projects are deployed with a git push, and the deployment script needs to…
rowatt
  • 421
  • 4
  • 16
3
votes
2 answers

Verify a bare Git repository has data

How does one verify that files were pushed to a bare repository correctly? Since bare repositories have no working tree, you obviously can't do a simple git log because it isn't picked up as a git repo. I realize there are solutions like suggested…
Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145
3
votes
1 answer

Git: importing from bare or from non-bare

I have been hosting bare repositories in my Home local server (Mac Mini). It has been performing really slow (maybe due to lack of git optimization for large files) So to solve this problem, I'm thinking to move my bare repo to BitBucket private…
bbnn
  • 3,505
  • 10
  • 50
  • 68
3
votes
2 answers

Git main repository update only if all tests pass, how to do?

I am trying to create git hook on update in main git repository. I want to prevent pushes that break any tests. How to get in bare repository code of project that will be after update to run tests for it? P.S.: It's possible, of course to use…
Alex
  • 185
  • 10
3
votes
2 answers

Pull from Git Bare Repository Doesn't Have Pushed Commits

I have a bare git repository that I've been using for backups. Every time I commit on the local copy, I push it to the bare repository. Git goes through and pushes the objects without any errors. Today I tried to double check that the backups…
codebaboon
  • 57
  • 1
  • 5
2
votes
1 answer

Update a Git Repository through a Git Hook in Python

I'm using python to write a post-receive hook that will hopefully serve for automatic deployment of all of the updated files in my project. Essentially, every time the "deploy" branch is pushed, it will upload the changed files over FTP to my…
Serplat
  • 4,367
  • 2
  • 18
  • 20
2
votes
2 answers

How can I get the GIT_PS1_SHOWDIRTYSTATE to not run against a bare repo?

So I've set up bash autocompletion for my install of git, and that rocks. However, I've got a bare repo that I occasionally have to directly interface with (git reset, for example), and any time I cd into the bare repo, the GIT_PS1_SHOWDIRTYSTATE…
jeffbyrnes
  • 2,182
  • 2
  • 22
  • 33
2
votes
0 answers

Dotfile management with bare git repo - question about gitignore

This is based on https://www.atlassian.com/git/tutorials/dotfiles. I don't understand this part: echo ".cfg" >> .gitignore It seems to be adding the dotfiles folder (in this case .cfg/) to ~/.gitignore (home directory). Why? It says it's to avoid…
Taylor Vance
  • 706
  • 1
  • 8
  • 22
2
votes
0 answers

libgit2 how to get merge conflict preview in buffer?

I'm want use libgit2 get a preview of a conflict commit in a bare repo, which means there is no workdir. have using those functions, git_merge_commits git_index_has_conflicts and git_index_conflict_get, to get relative infomation. Main code like…
LoranceChen
  • 2,453
  • 2
  • 22
  • 48
2
votes
3 answers

Set up Git to manage remote website

I've been trying to set up Git to manage my website, as explained per this tutorial and this one and this one and this one and this gist. To summarize what I've done: (in-depth explanations can be found in the tutorials) Set up a bare git repo on…
Robin Métral
  • 3,099
  • 3
  • 17
  • 32
2
votes
1 answer

git filter-branch - remove one of many submodules

I have been using git filter-branch a lot to get rid of legacy files, however for a bare git repo I cannot figure out how I can rewrite my git history where one of my git submodules is removed. I have a top-level repo "Donald" and below "Donald" I…
Peter Toft
  • 565
  • 7
  • 19
2
votes
3 answers

Git: Push a local git submodule, including submodule files, to a remote bare repository

I have two local projects which I manage with git, one being dependent on the other – like this: project A/ ├── project B/ │   ├── file B₁ │   ├── file B₂ │ ├── … It makes sense to me to have project B as a git submodule of project A. Now, I…
k.stm
  • 190
  • 13
2
votes
1 answer

clone only a specific branch to bare repo

I want to clone only a specific branch of a non bare repo to create a bare repo. So basically, from the git repo, I will do a git clone repo.git which will clone the existing repo and create a new folder repo.git. On doing a git branch in the new…
user2851669