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

Do I need to merge a branch in a bare repo?

In my setup I have three repos: A bare repo on remote server (/op/git/proj.git) A non-bare repo on remote server (/var/www/proj/.git) A non-bare repo on local machine (/var/www/proj/.git) The bare repo is origin to both ordinary repos on…
Majid Fouladpour
  • 29,356
  • 21
  • 76
  • 127
2
votes
1 answer

Git - Can't push to local bare repo on Windows

I've received a bare git repository to work on - let's call it bare.git. I've saved it into D:/workspace/bare.git and cloned it $git clone bare.git bare Everything worked normally untill I wanted to push my changes. I've received the following git…
W17chM4n
  • 21
  • 2
2
votes
1 answer

Server side had nothing changed after I used "git push" successfully

I created a bare repo on my VPS The repo's file folder is "~/repo" , I used "git init --bare" at "~/rpeo/.git" and then did nothing Then I cloned it and pushed something I got this result : $ git push origin master Counting objects: 19,…
ElvisKang
  • 77
  • 5
2
votes
1 answer

Git workflow involving a local repository and 2 remote repositories: staging and production repositories on the same server

I have read a few Stack Overflow threads about this, but many of them did not seem to answer the question that I was asking, or at least there were different conditions that didn't seem applicable to mine. How can I set up the following? Local…
olen
  • 21
  • 1
2
votes
1 answer

git push *to* a shallow clone, why not?

So everybody seems to be asking why one cannot push from a shallow clone (while I actually already achieved this). However what I'm interested in is pushing to a shallow server. This doesn't work (I've served the git repo via "git clone --bare…
knocte
  • 16,941
  • 11
  • 79
  • 125
2
votes
1 answer

Revert server to past commit with bare repository hooks

I have a server with a bare git repository that I push to for live deployment. It has a simple post-receive hook that updates my server code with the latest on master. I sometimes need to revert to a specific past commit when bugs are found on the…
treydavis
  • 35
  • 4
2
votes
2 answers

Git bare repository has master branch checked out?

I'm quite sure this question has been asked before but I dont seem to find it. So sorry if it is a dublicate. I have a bare repository lets call it project_x.git, if we check the config file it says [core] repositoryformatversion = 0 filemode =…
User123456
  • 671
  • 2
  • 9
  • 19
2
votes
1 answer

How to "attach" working dir to bare GIT repository

I have embedded Linux system that we want to store in Git. I have installed Git on the system, mount additional USB drive for storing Git data (bare repository). There is no problem with committing and pushing to the remote repository using commands…
user1557654
  • 51
  • 1
  • 5
1
vote
2 answers

Git bare repo with multiple branches

I want to make a git bare repository with multiple branches (master, develop, release, etc..). So question is if it is possible to checkout the bare repository or how to switch among the branches (does it make a sense to switch)? When I want to push…
Pepe
  • 213
  • 1
  • 5
  • 17
1
vote
1 answer

How to simple CI/CD with git bare repo

In Office, we use git bare repo to be our remote repo on NAS, we don't use gitlab or github etc. And we have another own remote server to host products(without git). I need to FTP to remote server and deploy manually everytime. At least, I want to…
KaiLee
  • 27
  • 1
  • 4
1
vote
1 answer

Git post-receive hook with two servers

We have two servers - ServerA (bare repo) and ServerB (hosted project folder). Every time a developer pushes local changes to ServerA they should be automatically pushed to ServerB. What I have tried so far: I created a post-receive script in…
edu
  • 11
  • 3
1
vote
1 answer

Is there a way to add submodules to a bare git repository?

I have some repos on my server with gitosis. One of them is Main, it's including all the others. I work with them from my local machine, and submodules hierarchy was built on my local machine. Gitosis has repos as bare(?) so, it's impossible to…
tijagi
  • 1,124
  • 1
  • 13
  • 31
1
vote
1 answer

Soft reset git bare branches

I have a set of GIT repositories that I always have different activities on differrent branches and they are all pushed to github the activities are linked to Redmine and would trigger Redmine to pick up the commits once a push happens. Since the…
Pok
  • 1,521
  • 1
  • 13
  • 20
1
vote
1 answer

How to create a git repo without a working directory?

I use git worktree concept to create multiple working directory. One for each feature and/or bug fix. So I will create a git clone of a repository once, and then I start creating worktree as needed. When I clone a git repository, by default a…
Darshan L
  • 824
  • 8
  • 30
1
vote
0 answers

How to retrieve/restore a GIT repository from bare repo

Created a bare repository using command "git clone --bare repo-url" and deleted the repository from GIT server. Now i want to retrieve/restore the repository from bare content in my local in windows machine. What are the steps to be followed?
Dinesh
  • 117
  • 3
  • 9