git-bare

Executing git commands on a bare repository

风流意气都作罢 提交于 2019-12-03 14:19:10
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 a non-bare git repository, this can be done with git ls-files but for bare repositories this (and most other git commands) don't work. I'm sure there's probably a simple way of doing this particular command, but I'll probably want to show some complicated/project-specific stats for different repositories, so I'm really asking if there's a way to

git ls-files in bare repository

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 04:45:41
问题 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 ls-files README.md file1.js file2.js file3.js folder1/file4.js folder2/file5.js In a bare git repository this fails silently. It just doesn't return any files (but exits successfully): $ cd my-bare-repository $ git ls-files #returns nothing $ echo $? #print exit code from previous command $ 0 Now I am aware that

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

隐身守侯 提交于 2019-12-03 04:12:13
问题 (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 repo; makes sense I guess) git branch (Nothing, it seems the bare repo doesn't contain any branches. Do I have to add them from a cloned repo?) cd .. mkdir test-clone cd test-clone git clone ../test-repo.git (I get a warning about cloning an empty

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

懵懂的女人 提交于 2019-12-02 20:32:55
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 location. I created the bare repository successfully on the host using git clone --bare <some-remote-location> . Now, when I point git to the new clone using git clone http://my.host.name/location , a message reports repository not found . When I capture network traffic, I see that git is attempting to access http://my.host.name/location/info/refs . This

git ls-files in bare repository

ε祈祈猫儿з 提交于 2019-12-02 17:57:32
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 ls-files README.md file1.js file2.js file3.js folder1/file4.js folder2/file5.js In a bare git repository this fails silently. It just doesn't return any files (but exits successfully): $ cd my-bare-repository $ git ls-files #returns nothing $ echo $? #print exit code from previous command $ 0 Now I am aware that I have to provide a meaningful branch or master to display. But how can I actually get this list of

Add git repository to existing folder on VSP

浪子不回头ぞ 提交于 2019-12-01 14:42:43
My Setup looks like this: Bare Repo in my Root /srv Folder Local Repo on my PC Gitlab Repo on well Gitlab I added two origins (Gitlab and my Bare Repo) to push all changes from my local machine to the source. Now I want to set up a post-receive Hook in my Bare Repo so it will update the working directory on my VSP (where the Bare Repo lies ) But I already developed before without git (all the files are the same), I don´t want to clone the Repo in another directory, but just add the .git Folder to my var/www/project . Is that possible with git? Or is there no clean way around cloning the Repo

Add git repository to existing folder on VSP

痴心易碎 提交于 2019-12-01 12:29:53
问题 My Setup looks like this: Bare Repo in my Root /srv Folder Local Repo on my PC Gitlab Repo on well Gitlab I added two origins (Gitlab and my Bare Repo) to push all changes from my local machine to the source. Now I want to set up a post-receive Hook in my Bare Repo so it will update the working directory on my VSP (where the Bare Repo lies ) But I already developed before without git (all the files are the same), I don´t want to clone the Repo in another directory, but just add the .git

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

荒凉一梦 提交于 2019-11-30 08:36:00
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 straightforward method to clone an empty, bare git repository? The ideal solution will support the -o option to give the remote repo a name other than origin , and it will be implementable as a simple shell script, e.g., git-clone-empty-repo . (Why I want to do this: I've set up a bare, empty git repo on our NetApp filer where it will be backed up, but I

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

◇◆丶佛笑我妖孽 提交于 2019-11-29 02:17:50
问题 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 directory Runs some migrations scripts and puts it live (if all is successful). The issue is my repository contains a submodule, which doesn't get put in the archive, and therefore doesn't get put in the release directory. I've seen git-archive-all, but

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

百般思念 提交于 2019-11-28 19:12:04
This question already has an answer here: How to convert a normal Git repository to a bare one? 16 answers I already created a repository. Can I make it a bare type or shall I start over? Jørn Schou-Rode According to the FAQ , conversion from non-bare to bare can be done in two ways. The best one: $ git clone --bare -l repo repo.git $ rm -rf repo To create a bare repository from scratch: $ mkdir repo.git $ cd repo.git $ git --bare init Bombe Just move the .git folder away from the working copy. mv /var/git/repo/repo/.git /var/git/repos/repo.git You might want to follow that up with a git