git-bare

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

回眸只為那壹抹淺笑 提交于 2019-12-22 09:13:51
问题 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 repo – why? As far as I know, push also contains a merge, but in this case we can do it well. So, the question could be “how does git merge work?”. Why does it need a HEAD ? What is it doing when merging? 回答1: As Chronial points out, pushing does

Adding things to a git bare repository

我是研究僧i 提交于 2019-12-21 20:37:07
问题 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? 回答1: if I add 1 file, only the 1 file is in that commit, aka we added something new and it's now set in stone There's several convenient ways to add a single-file commit to the tip of the master branch in a bare repo. So it appears i need to create a blob object, attach it to a tree, then attach that

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

北城余情 提交于 2019-12-20 10:06:04
问题 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

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

牧云@^-^@ 提交于 2019-12-18 12:53:14
问题 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

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

人走茶凉 提交于 2019-12-17 22:27:17
问题 This question already has answers here : How to convert a normal Git repository to a bare one? (16 answers) Closed 5 years ago . I already created a repository. Can I make it a bare type or shall I start over? 回答1: 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 回答2: Just move the .git folder away from the

Getting a working copy of a bare repository

泄露秘密 提交于 2019-12-17 18:15:17
问题 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? 回答1: You can simply clone the repository to another directory on the same machine: git clone /bare/repo/dir.git The current directory will become a non-bare clone of your repo, and you'll get a checkout of the master branch automatically. Then use the usual commands like git pull to update it as

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

做~自己de王妃 提交于 2019-12-13 11:38:49
问题 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 purpose does repo maintain the bare git repositories? And how are these bare repositories used by repo? (NB: Clarification: I am not talking about a git repository when I write "repo", I am talking specifically about the script called repo created by

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

感情迁移 提交于 2019-12-10 15:27:08
问题 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, but the push doesn't seem to see the bare repository as a Git repo . I have tried the following: git clone --mirror git://aserver.adomain.com/myrepo git remote set-url origin http://user@anotherserver.adomain.com/project/myrepo.git git push origin

git merging branches in a bare repository

末鹿安然 提交于 2019-12-09 15:18:17
问题 I would like to create the following setup for my git repos: I currently have a local git repo with all my working files. I would like to be able to setup a central bare repository, and two other non-bare repositories -- one for a live application and one for a testing version. I would like to be able to push changes from local to the central bare repo on a testing branch. Then, on my testing repo, always pull from the testing branch of the bare repository. When ready to go live with the

git logs not matching when setting --work-tree with push-to-deploy post-receive hook

纵饮孤独 提交于 2019-12-08 08:32:20
问题 I have setup push-to-deploy with my production server by setting up a --bare directory at /home/ubuntu/push-to-deploy/test.git , using that as my remote and adding a hooks/post-receive inside the --bare looking like this: #!/bin/bash while read oldrev newrev ref do branch=`echo $ref | cut -d/ -f3` if [ "production" == "$branch" -o "master" == "$branch" ]; then git --work-tree=/var/www/test/ checkout -f $branch sudo chown -R ubuntu:www-data /var/www/test echo 'Changes pushed to Amazon EC2 PROD