git-non-bare-repository

Why is it not a commit and a branch cannot be created from it?

邮差的信 提交于 2019-12-21 09:37:45
问题 I need to work with an intricate configuration of repositories. I have 5 of them: A remote central repository on machine 1. My local repository on my notebook (machine 2). A bare repository on machine 3. A repository on machine 3. A repository on machine 4 where we do code review. So, my understanding that it works this way: On my laptop (machine 2) I clone / pull from the central repository located on machine 1. I push the local repo to the machine 3 (using the bare repository as a

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

What are the consequences of using receive.denyCurrentBranch in Git?

三世轮回 提交于 2019-12-17 08:23:29
问题 I have a Git repository. I have cloned the repository and can commit my local changes. When I push my changes to the server it works. As soon as I create a branch, I checkout the branch, commit my work and then checkout the master branch. I then merge my local changes into the master branch. When I try to push to the server I get the following exception: Welcome to Git (version 1.7.11-preview20120620) Run 'git help git' to display the help index. Run 'git help <command>' to display help for

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

What are the consequences of using receive.denyCurrentBranch in Git?

[亡魂溺海] 提交于 2019-11-27 06:40:22
I have a Git repository. I have cloned the repository and can commit my local changes. When I push my changes to the server it works. As soon as I create a branch, I checkout the branch, commit my work and then checkout the master branch. I then merge my local changes into the master branch. When I try to push to the server I get the following exception: Welcome to Git (version 1.7.11-preview20120620) Run 'git help git' to display the help index. Run 'git help <command>' to display help for specific commands. $ git push origin master:master Counting objects: 9, done. Delta compression using up

How to push to a non-bare Git repository?

最后都变了- 提交于 2019-11-26 00:39:54
问题 I usually work on a remote server via ssh (screen and vim), where I have a Git repository. Sometimes I\'m not online, so I have a separate repository (cloned from my remote) on my laptop. However, I can\'t pull from this repository on remote side because I\'m usually behind a firewall or I don\'t have a public IP. I\'ve read that I should push just to a bare repository. How should I then push my changes to my remote repository? 回答1: receive.denyCurrentBranch updateInstead This options was

How do I properly force a Git push?

╄→尐↘猪︶ㄣ 提交于 2019-11-26 00:26:24
问题 I\'ve set up a remote non-bare \"main\" repo and cloned it to my computer. I made some local changes, updated my local repository, and pushed the changes back to my remote repo. Things were fine up to that point. Now, I had to change something in the remote repo. Then I changed something in my local repo. I realized that the change to the remote repo was not needed. So I tried to git push from my local repo to my remote repo, but I got an error like: To prevent you from losing history, non

How to convert a normal Git repository to a bare one?

拟墨画扇 提交于 2019-11-25 23:19:40
问题 How can I convert a \'normal\' Git repository to a bare one? The main difference seems to be: in the normal git repository you have a .git folder inside the repository containing all relevant data and all other files build your working copy in a bare Git repository, there is no working copy and the folder (let\'s call it repo.git ) contains the actual repository data 回答1: In short: replace the contents of repo with the contents of repo/.git , then tell the repository that it is now a bare