git-non-bare-repository https://www.e-learn.cn/tag/git-non-bare-repository zh-hans Why is it not a commit and a branch cannot be created from it? https://www.e-learn.cn/topic/2720156 <span>Why is it not a commit and a branch cannot be created from it?</span> <span><span lang="" about="/user/190" typeof="schema:Person" property="schema:name" datatype="">邮差的信</span></span> <span>2019-12-21 09:37:45</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>问题</h3><br /><p>I need to work with an intricate configuration of repositories. I have 5 of them:</p> <ol><li>A remote central repository on machine 1.</li> <li>My local repository on my notebook (machine 2).</li> <li>A bare repository on machine 3.</li> <li>A repository on machine 3.</li> <li>A repository on machine 4 where we do code review.</li> </ol><p>So, my understanding that it works this way:</p> <ol><li>On my laptop (machine 2) I clone / pull from the central repository located on machine 1.</li> <li>I push the local repo to the machine 3 (using the bare repository as a "intermediate").</li> </ol><p>Now I did some changes on the machine 3 and I want to push these changes to machine 4. Here are the instructions that I need to follow:</p> <ol><li>On machine 3 do all work in your test-branch, commit.</li> <li>Push to your bare repo on machine 3: git push origin test-branch</li> <li>On your laptop: fetch new commits from the machine-3 repo: git fetch machine3</li> <li>Check out your branch from machine 3: git checkout -b test-branch machine-3/test-branch</li> <li>Fetch commits from machine-4: git fetch origin</li> <li>git rebase origin/master</li> <li>git push origin HEAD:refs/for/master</li> </ol><p>I have problems with step 4. I get the following error:</p> <pre><code>fatal: 'machine3/test-branch' is not a commit and a branch 'test-branch' cannot be created from it </code></pre> <p><strong>ADDED</strong> </p> <p>When I execute</p> <pre><code>git rev-parse machine3/test-branch </code></pre> <p>On my laptop (machine 2) I get:</p> <pre><code>machine3/test-branch fatal: ambiguous argument 'machine3/test-branch': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git &lt;command&gt; [&lt;revision&gt;...] -- [&lt;file&gt;...]' </code></pre> <br /><h3>回答1:</h3><br /><p>For those who found this searching for an answer to <code>fatal: 'origin/branch' is not a commit and a branch 'branch' cannot be created from it</code>, you may also want to try <code>git fetch</code> first.</p> <p>If you run <code>git checkout -b local-branch-name origin/different-branch-name</code> without <code>fetch</code>ing first, you'll run into that error.</p> <p>Also, if you have multiple remotes (e.g. <code>origin</code>, then <code>buildserver</code>, <code>joespc</code>, etc.), you must specify the remote from which you're attempting to branch in your <code>git fetch</code> command, as it defaults to your first remote, usually <code>origin</code> (i.e. <code>git fetch origin</code>). So, for example, <code>git fetch buildserver</code> will fetch all the branches from the <code>buildserver</code> remote.</p> <br /><br /><br /><h3>回答2:</h3><br /><p>The question is complex / convolute, the answer is simple. There was a mismatch between the alias and machine3. The alias for the remote that has been used, was not for machine3. The machine3 had another alias. </p> <br /><br /><br /><h3>回答3:</h3><br /><p>If you're checking out a branch from a tag (like <code>git checkout -b XXXX v0.1.1</code>) , you can try <code>git fetch --tags</code> first.</p> <br /><br /><p>来源:<code>https://stackoverflow.com/questions/49297153/why-is-it-not-a-commit-and-a-branch-cannot-be-created-from-it</code></p></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/git" hreflang="zh-hans">git</a></div> <div class="field--item"><a href="/tag/git-non-bare-repository" hreflang="zh-hans">git-non-bare-repository</a></div> </div> </div> Sat, 21 Dec 2019 01:37:45 +0000 邮差的信 2720156 at https://www.e-learn.cn When creating a git repository that will be on the server, can I convert it to a bare repository? [duplicate] https://www.e-learn.cn/topic/2572057 <span>When creating a git repository that will be on the server, can I convert it to a bare repository? [duplicate]</span> <span><span lang="" about="/user/171" typeof="schema:Person" property="schema:name" datatype="">人走茶凉</span></span> <span>2019-12-17 22:27:17</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>问题</h3><br /><aside class="s-notice s-notice__info js-post-notice mb16" aria-hidden="false" role="status"><div class="grid fd-column fw-nowrap"> <div class="grid fw-nowrap"> <div class="grid--cell fl1 lh-lg"> <div class="grid--cell fl1 lh-lg"> <b>This question already has answers here</b>: </div> </div> </div> <div class="grid--cell mb0 mt4"> How to convert a normal Git repository to a bare one? <span class="question-originals-answer-count"> (16 answers) </span> </div> <div class="grid--cell mb0 mt8">Closed <span title="2014-07-30 18:43:05Z" class="relativetime">5 years ago</span>.</div> </div> </aside><p>I already created a repository. Can I make it a bare type or shall I start over?</p> <br /><h3>回答1:</h3><br /><p>According to the FAQ, conversion from non-bare to bare can be done in two ways. The best one:</p> <pre><code>$ git clone --bare -l repo repo.git $ rm -rf repo </code></pre> <p>To create a bare repository from scratch:</p> <pre><code>$ mkdir repo.git $ cd repo.git $ git --bare init </code></pre> <br /><br /><br /><h3>回答2:</h3><br /><p>Just move the <code>.git</code> folder away from the working copy.</p> <pre><code>mv /var/git/repo/repo/.git /var/git/repos/repo.git </code></pre> <p>You might want to follow that up with a</p> <pre><code>git config --bool core.bare true </code></pre> <p>in that repository, just in case <code>git</code> complains about something not being right.</p> <br /><br /><br /><h3>回答3:</h3><br /><pre><code>git clone --bare repo </code></pre> <p>This will give you a new bare version of <code>repo</code> named <code>repo.git</code>. Easy, no?</p> <br /><br /><p>来源:<code>https://stackoverflow.com/questions/1784506/when-creating-a-git-repository-that-will-be-on-the-server-can-i-convert-it-to-a</code></p></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/git" hreflang="zh-hans">git</a></div> <div class="field--item"><a href="/tag/git-bare" hreflang="zh-hans">git-bare</a></div> <div class="field--item"><a href="/tag/git-non-bare-repository" hreflang="zh-hans">git-non-bare-repository</a></div> </div> </div> Tue, 17 Dec 2019 14:27:17 +0000 人走茶凉 2572057 at https://www.e-learn.cn What are the consequences of using receive.denyCurrentBranch in Git? https://www.e-learn.cn/topic/2538589 <span>What are the consequences of using receive.denyCurrentBranch in Git?</span> <span><span lang="" about="/user/212" typeof="schema:Person" property="schema:name" datatype="">三世轮回</span></span> <span>2019-12-17 08:23:29</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>问题</h3><br /><p>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.</p> <p>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:</p> <pre><code>Welcome to Git (version 1.7.11-preview20120620) Run 'git help git' to display the help index. Run 'git help &lt;command&gt;' to display help for specific commands. $ git push origin master:master Counting objects: 9, done. Delta compression using up to 4 threads. Compressing objects: 100% (7/7), done. Writing objects: 100% (8/8), 13.68 KiB, done. Total 8 (delta 2), reused 1 (delta 0) Unpacking objects: 100% (8/8), done. remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branch in a non-bare repository remote: error: is denied, because it will make the index and work tree inconsistent remote: error: with what you pushed, and will require 'git reset --hard' to match remote: error: the work tree to HEAD. remote: error: remote: error: You can set 'receive.denyCurrentBranch' configuration variable to remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into remote: error: its current branch; however, this is not recommended unless you remote: error: arranged to update its work tree to match what you pushed in some remote: error: other way. remote: error: remote: error: To squelch this message and still keep the default behaviour, set remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'. To c:/jGit ! [remote rejected] master -&gt; master (branch is currently checked out) error: failed to push some refs to 'c:/gitRepository' </code></pre> <p>One solution is to run the following command:</p> <pre><code>git config receive.denyCurrentBranch ignore </code></pre> <p><strong>After this it works, but I would like to know why I need to use this option. Is this the only option? What are the consequences of doing this?</strong></p> <p>What I would really like to do is create branches, merge them into the master branch and then push my changes to the server.</p> <br /><h3>回答1:</h3><br /><p>The server where you are pushing to should use bare repository.</p> <p>How to convert a normal Git repository to a bare one?</p> <br /><br /><br /><h3>回答2:</h3><br /><h2>Why Git won't let you push to non-bare repositories</h2> <p>The original poster says:</p> <blockquote> <p>One solution is to run the following command:</p> <pre><code>git config receive.denyCurrentBranch ignore </code></pre> <p>After this it works, but I would like to know why I need to use this option. Is this the only option? What are the consequences of doing this?</p> </blockquote> <p>As I point out in my answer to a similar question, since Git version 1.6.2, Git won't let you push to a non-bare repository by default. This is because the <code>git push</code> command only updates the branch and <code>HEAD</code> references on the remote repository. What it <em>doesn't</em> do is also update the working-copy and staging-area in that non-bare remote.</p> <p>As a consequence, when you use <code>git status</code> in the remote repo, you'll see that the repo's previous state is still present in the working copy (and staged in the index):</p> <pre><code>$ git status On branch master Changes to be committed: (use "git reset HEAD &lt;file&gt;..." to unstage) new file: previous-state.txt </code></pre> <p>If you look at the error message that you got when you first tried to push to your non-bare remote repo with the <code>receive.denyCurrentBranch</code> setting set to the default <code>refuse</code> value, you'll see that the message tells you basically the same thing:</p> <pre><code>error: refusing to update checked out branch: refs/heads/master error: By default, updating the current branch in a non-bare repository error: is denied, because it will make the index and work tree inconsistent error: with what you pushed, and will require 'git reset --hard' to match error: the work tree to HEAD. error: error: You can set 'receive.denyCurrentBranch' configuration variable to error: 'ignore' or 'warn' in the remote repository to allow pushing into error: its current branch; however, this is not recommended unless you error: arranged to update its work tree to match what you pushed in some error: other way. </code></pre> <h2>You should really just push to bare Git repositories</h2> <p>As pointed out in some of the other answers, you shouldn't really be pushing to a non-bare repository, for the reasons I pointed out above, and which Git itself is telling you.</p> <p>So like what this answer states, a simple way to convert an existing non-bare repo to a bare one is to simply reclone it as a bare repo:</p> <pre><code>git clone --bare old-repo </code></pre> <p>Or you could try messing around with the <code>core.bare</code> config setting, as detailed in this answer.</p> <br /><br /><br /><h3>回答3:</h3><br /><p>I had the same error and needed the repository to be running as a dev test page online (that is, I guess, to keep a non-bare repo). Hopefully I solved it by initiating the repository with this series of commands (since git 2.3):</p> <pre><code>git init git config --global user.email "your@mail.here" git config --global user.name "Your Name" git commit git config receive.denyCurrentBranch updateInstead </code></pre> <p>As seen here: cannot push into git repository</p> <br /><br /><br /><h3>回答4:</h3><br /><p>You should have a bare repository on the server, not one with a checked-out working tree. Git is telling you it refuses to overwrite the branch that is currently checked out on the server.</p> <p>See this answer for information on how to convert your non-bare repository on the server to a bare one.</p> <br /><br /><br /><h3>回答5:</h3><br /><p>Autopsy of the Problem</p> <p>When a branch is checked out, committing will add a new commit with the current branch's head as its parent and move the branch's head to be that new commit.</p> <p>So</p> <pre><code>A ← B ↑ [HEAD,branch1] </code></pre> <p>becomes</p> <pre><code>A ← B ← C ↑ [HEAD,branch1] </code></pre> <p>But if someone could push to that branch inbetween, the user would get itself in what git calls detached head mode:</p> <pre><code>A ← B ← X ↑ ↑ [HEAD] [branch1] </code></pre> <p>Now the user is not in branch1 anymore, without having explicitly asked to check out another branch. Worse, the user is now outside any branch, and any new commit will just be dangling:</p> <pre><code> [HEAD] ↓ C ↙ A ← B ← X ↑ [branch1] </code></pre> <p>Hypothetically, if at this point, the user checks out another branch, then this dangling commit becomes fair game for Git's <strong>garbage collector</strong>.</p> <br /><br /><br /><h3>回答6:</h3><br /><p>I think a non bare repository can be useful when man configures the git <em>update hook</em> to deploy from the repository itself after the push happened. Just do not forget to reset the repository. If you miss that step files wont track the actual state...</p> <br /><br /><p>来源:<code>https://stackoverflow.com/questions/12265729/what-are-the-consequences-of-using-receive-denycurrentbranch-in-git</code></p></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/git" hreflang="zh-hans">git</a></div> <div class="field--item"><a href="/tag/git-push" hreflang="zh-hans">git-push</a></div> <div class="field--item"><a href="/tag/git-config" hreflang="zh-hans">git-config</a></div> <div class="field--item"><a href="/tag/git-non-bare-repository" hreflang="zh-hans">git-non-bare-repository</a></div> </div> </div> Tue, 17 Dec 2019 00:23:29 +0000 三世轮回 2538589 at https://www.e-learn.cn When creating a git repository that will be on the server, can I convert it to a bare repository? [duplicate] https://www.e-learn.cn/topic/537237 <span>When creating a git repository that will be on the server, can I convert it to a bare repository? [duplicate]</span> <span><span lang="" about="/user/208" typeof="schema:Person" property="schema:name" datatype="">百般思念</span></span> <span>2019-11-28 19:12:04</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><div class="alert alert-danger" role="alert"> <div class="question-status question-originals-of-duplicate"> <p>This question already has an answer here:</p> <ul><li> <a href="/questions/2199897/how-to-convert-a-normal-git-repository-to-a-bare-one" dir="ltr" rel="nofollow">How to convert a normal Git repository to a bare one?</a> <span class="question-originals-answer-count"> 16 answers </span> </li> </ul></div> <p>I already created a repository. Can I make it a bare type or shall I start over?</p> </div><div class="panel panel-info"><div class="panel-heading">Jørn Schou-Rode</div><div class="panel-body"> <p>According to the <a href="https://git.wiki.kernel.org/index.php/Git_FAQ#How_do_I_make_existing_non-bare_repository_bare.3F" rel="nofollow">FAQ</a>, conversion from non-bare to bare can be done in two ways. The best one:</p> <pre><code>$ git clone --bare -l repo repo.git $ rm -rf repo </code></pre> <p>To create a bare repository from scratch:</p> <pre><code>$ mkdir repo.git $ cd repo.git $ git --bare init </code></pre> </div></div><div class="panel panel-info"><div class="panel-heading">Bombe</div><div class="panel-body"> <p>Just move the <code>.git</code> folder away from the working copy.</p> <pre><code>mv /var/git/repo/repo/.git /var/git/repos/repo.git </code></pre> <p>You might want to follow that up with a</p> <pre><code>git config --bool core.bare true </code></pre> <p>in that repository, just in case <code>git</code> complains about something not being right.</p> </div></div><div class="panel panel-info"><div class="panel-heading"></div><div class="panel-body"> <pre><code>git clone --bare repo </code></pre> <p>This will give you a new bare version of <code>repo</code> named <code>repo.git</code>. Easy, no?</p> </div></div><div class="alert alert-warning" role="alert"><p>来源:<code>https://stackoverflow.com/questions/1784506/when-creating-a-git-repository-that-will-be-on-the-server-can-i-convert-it-to-a</code></p></div></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/git" hreflang="zh-hans">git</a></div> <div class="field--item"><a href="/tag/git-bare" hreflang="zh-hans">git-bare</a></div> <div class="field--item"><a href="/tag/git-non-bare-repository" hreflang="zh-hans">git-non-bare-repository</a></div> </div> </div> Thu, 28 Nov 2019 11:12:04 +0000 百般思念 537237 at https://www.e-learn.cn What are the consequences of using receive.denyCurrentBranch in Git? https://www.e-learn.cn/topic/262652 <span>What are the consequences of using receive.denyCurrentBranch in Git?</span> <span><span lang="" about="/user/122" typeof="schema:Person" property="schema:name" datatype="">[亡魂溺海]</span></span> <span>2019-11-27 06:40:22</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><div class="alert alert-danger" role="alert"> <p>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.</p> <p>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:</p> <pre><code>Welcome to Git (version 1.7.11-preview20120620) Run 'git help git' to display the help index. Run 'git help &lt;command&gt;' to display help for specific commands. $ git push origin master:master Counting objects: 9, done. Delta compression using up to 4 threads. Compressing objects: 100% (7/7), done. Writing objects: 100% (8/8), 13.68 KiB, done. Total 8 (delta 2), reused 1 (delta 0) Unpacking objects: 100% (8/8), done. remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branch in a non-bare repository remote: error: is denied, because it will make the index and work tree inconsistent remote: error: with what you pushed, and will require 'git reset --hard' to match remote: error: the work tree to HEAD. remote: error: remote: error: You can set 'receive.denyCurrentBranch' configuration variable to remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into remote: error: its current branch; however, this is not recommended unless you remote: error: arranged to update its work tree to match what you pushed in some remote: error: other way. remote: error: remote: error: To squelch this message and still keep the default behaviour, set remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'. To c:/jGit ! [remote rejected] master -&gt; master (branch is currently checked out) error: failed to push some refs to 'c:/gitRepository' </code></pre> <p>One solution is to run the following command:</p> <pre><code>git config receive.denyCurrentBranch ignore </code></pre> <p><strong>After this it works, but I would like to know why I need to use this option. Is this the only option? What are the consequences of doing this?</strong></p> <p>What I would really like to do is create branches, merge them into the master branch and then push my changes to the server.</p> </div><div class="panel panel-info"><div class="panel-heading">kan</div><div class="panel-body"> <p>The server where you are pushing to should use bare repository.</p> <p><a href="https://stackoverflow.com/questions/2199897/how-to-convert-a-git-repository-from-normal-to-bare" rel="nofollow">How to convert a normal Git repository to a bare one?</a></p> </div></div><div class="panel panel-info"><div class="panel-heading"></div><div class="panel-body"> <h2>Why Git won't let you push to non-bare repositories</h2> <p>The original poster says:</p> <blockquote> <p>One solution is to run the following command:</p> <pre><code>git config receive.denyCurrentBranch ignore </code></pre> <p>After this it works, but I would like to know why I need to use this option. Is this the only option? What are the consequences of doing this?</p> </blockquote> <p>As I point out in <a href="https://stackoverflow.com/a/24987631/456814" rel="nofollow">my answer to a similar question</a>, since Git version 1.6.2, <a href="https://github.com/git/git/blob/v1.6.2/Documentation/RelNotes-1.6.2.txt#L4-L7" rel="nofollow">Git won't let you push to a non-bare repository by default</a>. This is because the <code>git push</code> command only updates the branch and <code>HEAD</code> references on the remote repository. What it <em>doesn't</em> do is also update the working-copy and staging-area in that non-bare remote.</p> <p>As a consequence, when you use <code>git status</code> in the remote repo, you'll see that the repo's previous state is still present in the working copy (and staged in the index):</p> <pre><code>$ git status On branch master Changes to be committed: (use "git reset HEAD &lt;file&gt;..." to unstage) new file: previous-state.txt </code></pre> <p>If you look at the error message that you got when you first tried to push to your non-bare remote repo with the <code>receive.denyCurrentBranch</code> setting set to the default <code>refuse</code> value, you'll see that the message tells you basically the same thing:</p> <pre><code>error: refusing to update checked out branch: refs/heads/master error: By default, updating the current branch in a non-bare repository error: is denied, because it will make the index and work tree inconsistent error: with what you pushed, and will require 'git reset --hard' to match error: the work tree to HEAD. error: error: You can set 'receive.denyCurrentBranch' configuration variable to error: 'ignore' or 'warn' in the remote repository to allow pushing into error: its current branch; however, this is not recommended unless you error: arranged to update its work tree to match what you pushed in some error: other way. </code></pre> <h2>You should really just push to bare Git repositories</h2> <p>As pointed out in <a href="https://stackoverflow.com/a/12266187/456814" rel="nofollow">some of</a> the <a href="https://stackoverflow.com/a/12266232/456814" rel="nofollow">other answers</a>, you shouldn't really be pushing to a non-bare repository, for the reasons I pointed out above, and which Git itself is telling you.</p> <p>So like what <a href="https://stackoverflow.com/a/2199939/456814" rel="nofollow">this answer</a> states, a simple way to convert an existing non-bare repo to a bare one is to simply reclone it as a bare repo:</p> <pre><code>git clone --bare old-repo </code></pre> <p>Or you could try messing around with the <code>core.bare</code> config setting, as detailed in <a href="https://stackoverflow.com/a/2200662/456814" rel="nofollow">this answer</a>.</p> </div></div><div class="panel panel-info"><div class="panel-heading">Fanky</div><div class="panel-body"> <p>I had the same error and needed the repository to be running as a dev test page online (that is, I guess, to keep a non-bare repo). Hopefully I solved it by initiating the repository with this series of commands (since git 2.3):</p> <pre><code>git init git config --global user.email "your@mail.here" git config --global user.name "Your Name" git commit git config receive.denyCurrentBranch updateInstead </code></pre> <p>As seen here: <a href="https://stackoverflow.com/questions/3221859/cannot-push-into-git-repository" rel="nofollow">cannot push into git repository</a></p> </div></div><div class="panel panel-info"><div class="panel-heading">Carl-Eric Menzel</div><div class="panel-body"> <p>You should have a bare repository on the server, not one with a checked-out working tree. Git is telling you it refuses to overwrite the branch that is currently checked out on the server.</p> <p>See <a href="https://stackoverflow.com/questions/2199897/how-to-convert-a-git-repository-from-normal-to-bare" rel="nofollow">this answer</a> for information on how to convert your non-bare repository on the server to a bare one.</p> </div></div><div class="panel panel-info"><div class="panel-heading"></div><div class="panel-body"> <p>Autopsy of the Problem</p> <p>When a branch is checked out, committing will add a new commit with the current branch's head as its parent and move the branch's head to be that new commit.</p> <p>So</p> <pre><code>A ← B ↑ [HEAD,branch1] </code></pre> <p>becomes</p> <pre><code>A ← B ← C ↑ [HEAD,branch1] </code></pre> <p>But if someone could push to that branch inbetween, the user would get itself in what git calls detached head mode:</p> <pre><code>A ← B ← X ↑ ↑ [HEAD] [branch1] </code></pre> <p>Now the user is not in branch1 anymore, without having explicitly asked to check out another branch. Worse, the user is now outside any branch, and any new commit will just be dangling:</p> <pre><code> [HEAD] ↓ C ↙ A ← B ← X ↑ [branch1] </code></pre> <p>Hypothetically, if at this point, the user checks out another branch, then this dangling commit becomes fair game for Git's <strong>garbage collector</strong>.</p> </div></div><div class="panel panel-info"><div class="panel-heading"></div><div class="panel-body"> <p>I think a non bare repository can be useful when man configures the git <em>update hook</em> to deploy from the repository itself after the push happened. Just do not forget to reset the repository. If you miss that step files wont track the actual state...</p> </div></div><div class="alert alert-warning" role="alert"><p>来源:<code>https://stackoverflow.com/questions/12265729/what-are-the-consequences-of-using-receive-denycurrentbranch-in-git</code></p></div></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/git" hreflang="zh-hans">git</a></div> <div class="field--item"><a href="/tag/git-push" hreflang="zh-hans">git-push</a></div> <div class="field--item"><a href="/tag/git-config" hreflang="zh-hans">git-config</a></div> <div class="field--item"><a href="/tag/git-non-bare-repository" hreflang="zh-hans">git-non-bare-repository</a></div> </div> </div> Tue, 26 Nov 2019 22:40:22 +0000 [亡魂溺海] 262652 at https://www.e-learn.cn How to push to a non-bare Git repository? https://www.e-learn.cn/topic/15955 <span>How to push to a non-bare Git repository?</span> <span><span lang="" about="/user/46" typeof="schema:Person" property="schema:name" datatype="">最后都变了-</span></span> <span>2019-11-26 00:39:54</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>问题</h3><br /><p>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.</p> <p>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.</p> <p>I\'ve read that I should push just to a bare repository. How should I then push my changes to my remote repository?</p> <br /><h3>回答1:</h3><br /><p><strong><code>receive.denyCurrentBranch updateInstead</code></strong></p> <p>This options was added in Git 2.3, and it makes the server update its working tree if it is clean.</p> <p>So if you ensure that you always commit before you pull locally, and keep a clean working tree on the server (which you should do to avoid having merge conflicts), then this option is a good solution.</p> <p>Sample usage:</p> <pre><code>git init server cd server touch a git add . git commit -m 0 git config --local receive.denyCurrentBranch updateInstead cd .. git clone server local cd local touch b git add . git commit -m 1 git push origin master:master cd ../server ls </code></pre> <p>Output:</p> <pre><code>a b </code></pre> <br /><br /><br /><h3>回答2:</h3><br /><p><strong>Best Option</strong></p> <p>Probably the cleanest, least confusing, and safest way to push into your non-bare remote repository, is to push to dedicated branches in the remote that represent your laptop branches.</p> <p>Let's look at the simplest case, and assume you have just one branch in each repo: master. When you push to the remote repo from your laptop, instead of pushing master -&gt; master, push master -&gt; laptop-master (or a similar name). This way the push doesn't affect the currently checked-out master branch in the remote repo. To do this from the laptop, the command is pretty simple:</p> <pre><code>git push origin master:laptop-master </code></pre> <p>This means that the local master branch will be pushed to the branch named "laptop-master" in the remote repository. In your remote repo, you'll have a new branch named "laptop-master" that you can then merge into your remote master when you are ready.</p> <p><strong>Alternate Option</strong></p> <p>It's also possible to just push master -&gt; master, but pushing to the currently checked-out branch of a non-bare repo is generally not recommended, because it can be confusing if you don't understand what is going on. This is because pushing to a checked-out branch doesn't update the work tree, so checking <code>git status</code> in the checked-out branch that was pushed into will show exactly the opposite differences as what was most recently pushed. It would get especially confusing if the work tree was dirty before the push was done, which is a big reason why this is not recommended.</p> <p>If you want to try just pushing master -&gt; master, then the command is just:</p> <pre><code>git push origin </code></pre> <p>But when you go back to the remote repo, you'll most likely want to do a <code>git reset --hard HEAD</code> to get the work tree in sync with the content that was pushed. <em>This can be dangerous</em>, because if there are any <em>uncommitted</em> changes in the remote work tree that you wanted to keep it will wipe them out. Be sure you know what the consequences of this are before you try it, or at least make a backup first!</p> <p><strong>EDIT</strong> Since Git 2.3, you can use "push-to-deploy" git push: https://github.com/blog/1957-git-2-3-has-been-released. But pushing to a separate branch and then merging is usually better since it does an actual merge (hence works with uncommitted changes just like merge does).</p> <br /><br /><br /><h3>回答3:</h3><br /><p>I would suggest to have a bare-repository and a local working (non-bare) repos in your server. You could push changes from laptop to server bare repo and then pull from that bare repo to server working repo. The reason I say this is because you might have many complete/incomplete branches in server which you will want to replicate on the laptop. </p> <p>This way you don't have to worry about the state of the branch checked out on server working repo while pushing changes to server. </p> <br /><br /><br /><h3>回答4:</h3><br /><p>Another option is to setup a reverse ssh tunnel so that you can pull instead of push.</p> <pre><code># start the tunnel from the natted box you wish to pull from (local) $ ssh -R 1234:localhost:22 user@remote # on the other box (remote) $ git remote add other-side ssh://user@localhost:1234/the/repo $ git pull other-side </code></pre> <p>And if you want the tunnel to run in the background</p> <pre><code>$ ssh -fNnR 1234:localhost:22 user@remote </code></pre> <br /><br /><br /><h3>回答5:</h3><br /><p>You can do:</p> <p><code>$git config --bool core.bare true</code></p> <p>this can be done in bare or central repository so that it will accept any files that are pushed from non bare repositories. If you do this in non bare repository then we cannot push any files from non bare to bare repository.</p> <p>If you are practicing GIT by creating central and non bare repo in PC it might not show the pushed files in some PC's but it has been pushed. you can check it by running.</p> <p><code>$git log</code> in central repo.</p> <p>Other than if you push to GitHub it will show the files there.</p> <br /><br /><p>来源:<code>https://stackoverflow.com/questions/1764380/how-to-push-to-a-non-bare-git-repository</code></p></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/git" hreflang="zh-hans">git</a></div> <div class="field--item"><a href="/tag/git-push" hreflang="zh-hans">git-push</a></div> <div class="field--item"><a href="/tag/git-non-bare-repository" hreflang="zh-hans">git-non-bare-repository</a></div> </div> </div> Mon, 25 Nov 2019 16:39:54 +0000 最后都变了- 15955 at https://www.e-learn.cn How do I properly force a Git push? https://www.e-learn.cn/topic/14657 <span>How do I properly force a Git push?</span> <span><span lang="" about="/user/113" typeof="schema:Person" property="schema:name" datatype="">╄→尐↘猪︶ㄣ</span></span> <span>2019-11-26 00:26:24</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>问题</h3><br /><p>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.</p> <p>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 <code>git push</code> from my local repo to my remote repo, but I got an error like:</p> <blockquote> <p>To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the \'Note about fast-forwards\' section of <code>git push --help</code> for details.</p> </blockquote> <p>I thought that probably a</p> <pre><code>git push --force </code></pre> <p>would force my local copy to push changes to the remote one and make it the same. <strong>It does force the update</strong>, but when I go back to the remote repo and make a commit, I notice that the files contain outdated changes (ones that the main remote repo previously had).</p> <p>As I mentioned in the comments to one of the answers:</p> <blockquote> <p>[I] tried forcing, but when going back to master server to save the changes, i get outdated staging. Thus, when i commit the repositories are not the same. And when i try to use git push again, i get the same error.</p> </blockquote> <p>How can I fix this issue?</p> <br /><h3>回答1:</h3><br /><p>Just do:</p> <pre><code>git push origin &lt;your_branch_name&gt; --force </code></pre> <p>or if you have a specific repo:</p> <pre><code>git push https://git.... --force </code></pre> <p>This will delete your previous commit(s) and push your current one.</p> <p>It may not be proper, but if anyone stumbles upon this page, thought they might want a simple solution...</p> <h3>Short flag</h3> <p>Also note that <code>-f</code> is short for <code>--force</code>, so</p> <pre><code>git push origin &lt;your_branch_name&gt; -f </code></pre> <p>will also work.</p> <br /><br /><br /><h3>回答2:</h3><br /><p>And if <code>push --force</code> doesn't work you can do <strong><code>push --delete</code></strong>. Look at 2<sup>nd</sup> line on this instance:</p> <pre class="lang-bash prettyprint-override"><code>git reset --hard HEAD~3 # reset current branch to 3 commits ago git push origin master --delete # do a very very bad bad thing git push origin master # regular push </code></pre> <p>But beware...</p> <h1>Never ever go back on a public git history!</h1> <p>In other words:</p> <ul><li>Don't ever <code>force</code> push on a public repository.</li> <li>Don't do this or anything that can break someone's <code>pull</code>.</li> <li>Don't ever <code>reset</code> or <code>rewrite</code> history in a <em>repo</em> someone might have already pulled.</li> </ul><p>Of course there are exceptionally rare exceptions even to this rule, but in most cases it's not needed to do it and it will generate problems to everyone else.</p> <h1>Do a revert instead.</h1> <p>And <strong>always be careful with what you push to a public repo</strong>. Reverting:</p> <pre class="lang-bash prettyprint-override"><code>git revert -n HEAD~3..HEAD # prepare a new commit reverting last 3 commits git commit -m "sorry - revert last 3 commits because I was not careful" git push origin master # regular push </code></pre> <p>In effect, <strong>both</strong> origin HEADs (from the <strong>revert</strong> and from the <strong>evil reset</strong>) will contain the same files.</p> <hr /><h3>edit to add updated info and more arguments around <code>push --force</code></h3> <h2>Consider pushing force with lease instead of push, but still prefer revert</h2> <p>Another problem <code>push --force</code> may bring is when someone push anything before you do, but after you've already fetched. If you push force your <em>rebased</em> version now you will <strong>replace work from others</strong>.</p> <p><code>git push --force-with-lease</code> introduced in the git 1.8.5 (thanks to @VonC comment on the question) tries to address this specific issue. Basically, it will bring an error and not push if the remote was modified since your latest fetch.</p> <p>This is good if you're really sure a <code>push --force</code> is needed, but still want to prevent more problems. I'd go as far to say it should be the default <code>push --force</code> behaviour. But it's still far from being an excuse to force a <code>push</code>. People who <em>fetched</em> before your <em>rebase</em> will still have lots of troubles, which could be easily avoided if you had <em>reverted</em> instead.</p> <p>And since we're talking about <code>git --push</code> instances...</p> <h2>Why would anyone want to force push?</h2> <p>@linquize brought a good push force example on the comments: <strong>sensitive data</strong>. You've wrongly leaked data that shouldn't be pushed. If you're fast enough, you can <em>"fix"</em><code>*</code> it by forcing a push on top.</p> <p><code>*</code> The data will still be on the remote unless you also do a garbage collect, or clean it somehow. There is also the obvious potential for it to be spread by others who'd <em>fetched</em> it already, but you get the idea.</p> <br /><br /><br /><h3>回答3:</h3><br /><p>First of all, I would not make any changes directly in the "main" repo. If you really want to have a "main" repo, then you should only push to it, never change it directly.</p> <p>Regarding the error you are getting, have you tried <code>git pull</code> from your local repo, and then <code>git push</code> to the main repo? What you are currently doing (if I understood it well) is forcing the push and then losing your changes in the "main" repo. You should merge the changes locally first.</p> <br /><br /><br /><h3>回答4:</h3><br /><p>If I'm on my local branch A, and I want to force push local branch B to the origin branch C I can use the following syntax:</p> <pre><code>git push --force origin B:C </code></pre> <br /><br /><br /><h3>回答5:</h3><br /><p>I would really recommend to:</p> <ul><li><p>push only to the main repo</p></li> <li><p>make sure that main repo is a bare repo, in order to never have any problem with the main repo working tree being not in sync with its <code>.git</code> base. See "How to push a local git repository to another computer?"</p></li> <li><p>If you do have to make modification in the main (bare) repo, clone it (on the main server), do your modification and push back to it</p></li> </ul><p>In other words, keep a bare repo accessible both from the main server and the local computer, in order to have a single upstream repo from/to which to pull/pull.</p> <br /><br /><br /><h3>回答6:</h3><br /><p>use this following command:</p> <pre><code>git push -f origin master </code></pre> <br /><br /><br /><h3>回答7:</h3><br /><p>This was our solution for replacing master on a corporate gitHub repository while maintaining history.</p> <p><code>push -f</code> to master on corporate repositories is often disabled to maintain branch history. This solution worked for us.</p> <pre><code>git fetch desiredOrigin git checkout -b master desiredOrigin/master // get origin master </code></pre> <hr /><pre><code>git checkout currentBranch // move to target branch git merge -s ours master // merge using ours over master // vim will open for the commit message git checkout master // move to master git merge currentBranch // merge resolved changes into master </code></pre> <hr /><p>push your branch to <code>desiredOrigin</code> and create a PR</p> <br /><br /><br /><h3>回答8:</h3><br /><p>I had the same question but figured it out finally. What you most likely need to do is run the following two git commands (replacing hash with the git commit revision number):</p> <pre><code>git checkout &lt;hash&gt; git push -f HEAD:master </code></pre> <br /><br /><p>来源:<code>https://stackoverflow.com/questions/5509543/how-do-i-properly-force-a-git-push</code></p></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/git" hreflang="zh-hans">git</a></div> <div class="field--item"><a href="/tag/push" hreflang="zh-hans">push</a></div> <div class="field--item"><a href="/tag/git-push" hreflang="zh-hans">git-push</a></div> <div class="field--item"><a href="/tag/git-non-bare-repository" hreflang="zh-hans">git-non-bare-repository</a></div> </div> </div> Mon, 25 Nov 2019 16:26:24 +0000 ╄→尐↘猪︶ㄣ 14657 at https://www.e-learn.cn How to convert a normal Git repository to a bare one? https://www.e-learn.cn/topic/10139 <span>How to convert a normal Git repository to a bare one?</span> <span><span lang="" about="/user/242" typeof="schema:Person" property="schema:name" datatype="">拟墨画扇</span></span> <span>2019-11-25 23:19:40</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>问题</h3><br /><p>How can I convert a \'normal\' Git repository to a bare one?</p> <p>The main difference seems to be:</p> <ul><li><p>in the normal git repository you have a <code>.git</code> folder inside the repository containing all relevant data and all other files build your working copy</p></li> <li><p>in a bare Git repository, there is no working copy and the folder (let\'s call it <code>repo.git</code>) contains the actual repository data</p></li> </ul><br /><h3>回答1:</h3><br /><p>In short: replace the contents of <code>repo</code> with the contents of <code>repo/.git</code>, then tell the repository that it is now a bare repository.</p> <p>To do this, execute the following commands:</p> <pre><code>cd repo mv .git ../repo.git # renaming just for clarity cd .. rm -fr repo cd repo.git git config --bool core.bare true </code></pre> <p>Note that this is different from doing a <code>git clone --bare</code> to a new location (see below).</p> <br /><br /><br /><h3>回答2:</h3><br /><p>Your method looks like it would work; the file structure of a bare repository is just what is inside the .git directory. But I don't know if any of the files are actually changed, so if that fails, you can just do</p> <pre><code>git clone --bare /path/to/repo </code></pre> <p>You'll probably need to do it in a different directory to avoid a name conflict, and then you can just move it back to where you want. And you may need to change the config file to point to wherever your origin repo is.</p> <br /><br /><br /><h3>回答3:</h3><br /><p>I think the following link would be helpful</p> <p>GitFaq: How do I make existing non-bare repository bare?</p> <pre><code>$ mv repo/.git repo.git $ git --git-dir=repo.git config core.bare true $ rm -rf repo </code></pre> <br /><br /><br /><h3>回答4:</h3><br /><p>Unless you specifically want or need to twiddle bits on the filesystem, it really is dead simple to create a bare version of a non-bare repository (mentioned in several other posts here). It’s part of git’s core functionality:</p> <p><code>git clone --bare existing_repo_path bare_repo_path</code></p> <br /><br /><br /><h3>回答5:</h3><br /><p>Please also consider to use</p> <pre><code>git clone --mirror path_to_source_repository </code></pre> <p>From the documentation:</p> <blockquote> <p>Set up a mirror of the source repository. This implies --bare. Compared to --bare, --mirror not only maps local branches of the source to local branches of the target, it maps all refs (including remote-tracking branches, notes etc.) and sets up a refspec configuration such that all these refs are overwritten by a git remote update in the target repository.</p> </blockquote> <br /><br /><br /><h3>回答6:</h3><br /><p>I just wanted to push to a repository on a network path but git would not let me do that unless that repository was marked as bare. All I needed was to change its config:</p> <pre><code>git config --bool core.bare true </code></pre> <p>No need to fiddle with the files unless you want to keep it clean.</p> <br /><br /><br /><h3>回答7:</h3><br /><p>i've read the answers and i have done this:</p> <pre><code>cd repos mv .git repos.git cd repos.git git config --bool core.bare true # from another answer cd ../ mv repos.git ../ cd ../ rm -rf repos/ # or delete using a file manager if you like </code></pre> <p>this will leave the contents of <code>repos/.git</code> as the bare <code>repos.git</code></p> <br /><br /><br /><h3>回答8:</h3><br /><p>Here's what I think is safest and simplest. There is nothing here not stated above. I just want to see an answer that shows a safe step-by-step procedure. You start one folder up from the repository (repo) you want to make bare. I've adopted the convention implied above that bare repository folders have a .git extension.</p> <pre><code>(1) Backup, just in case. (a) &gt; mkdir backup (b) &gt; cd backup (c) &gt; git clone ../repo (2) Make it bare, then move it (a) &gt; cd ../repo (b) &gt; git config --bool core.bare true (c) &gt; mv .git ../repo.git (3) Confirm the bare repository works (optional, since we have a backup) (a) &gt; cd .. (b) &gt; mkdir test (c) &gt; cd test (d) &gt; git clone ../repo.git (4) Clean up (a) &gt; rm -Rf repo (b) (optional) &gt; rm -Rf backup/repo (c) (optional) &gt; rm -Rf test/repo </code></pre> <br /><br /><br /><h3>回答9:</h3><br /><p>Simply read</p> <p>Pro Git Book: 4.2 Git on the Server - Getting Git on a Server</p> <p>which boild down to</p> <pre><code>$ git clone --bare my_project my_project.git Cloning into bare repository 'my_project.git'... done. </code></pre> <p>Then put <em>my_project.git</em> to the server</p> <p>Which mainly is, what answer #42 tried to point out. Shurely one could reinvent the wheel ;-)</p> <br /><br /><br /><h3>回答10:</h3><br /><p>Here is a little BASH function you can add to your .bashrc or .profile on a UNIX based system. Once added and the shell is either restarted or the file is reloaded via a call to <code>source ~/.profile</code> or <code>source ~/.bashrc</code>.</p> <pre><code>function gitToBare() { if [ -d ".git" ]; then DIR="`pwd`" mv .git .. rm -fr * mv ../.git . mv .git/* . rmdir .git git config --bool core.bare true cd .. mv "${DIR}" "${DIR}.git" printf "[\x1b[32mSUCCESS\x1b[0m] Git repository converted to " printf "bare and renamed to\n ${DIR}.git\n" cd "${DIR}.git" else printf "[\x1b[31mFAILURE\x1b[0m] Cannot find a .git directory\n" fi } </code></pre> <p>Once called within a directory containing a .git directory, it will make the appropriate changes to convert the repository. If there is no .git directory present when called, a FAILURE message will appear and no file system changes will happen.</p> <br /><br /><br /><h3>回答11:</h3><br /><p>The methods that say to remove files and muck about with moving the .git directory are not clean and not using the "git" method of doing something that's should be simple. This is the cleanest method I have found to convert a normal repo into a bare repo.</p> <p>First clone /path/to/normal/repo into a bare repo called repo.git</p> <pre><code>git clone --bare /path/to/normal/repo </code></pre> <p>Next remove the origin that points to /path/to/normal/repo</p> <pre><code>cd repo.git git remote rm origin </code></pre> <p>Finally you can remove your original repo. You could rename repo.git to repo at that point, but the standard convention to signify a git repository is something.git, so I'd personally leave it that way.</p> <p>Once you've done all that, you can clone your new bare repo (which in effect creates a normal repo, and is also how you would convert it from bare to normal)</p> <p>Of course if you have other upstreams, you'll want to make a note of them, and update your bare repo to include it. But again, it can all be done with the git command. Remember the man pages are your friend.</p> <br /><br /><br /><h3>回答12:</h3><br /><p>In case you have a repository with few local checkedout branches /refs/heads/* and few remote branch branches remotes/origin/* AND if you want to convert this into a BARE repository with all branches in /refs/heads/*</p> <p>you can do the following to save the history. </p> <ol><li>create a bare repository</li> <li>cd into the local repository which has local checkedout branches and remote branches</li> <li>git push /path/to/bare/repo +refs/remotes/origin/<em>:refs/heads/</em> </li> </ol><br /><br /><br /><h3>回答13:</h3><br /><p>I used the following script to read a text file that has a list of all my SVN repos and convert them to GIT, and later use git clone --bare to convert to a bare git repo</p> <pre><code>#!/bin/bash file="list.txt" while IFS= read -r repo_name do printf '%s\n' "$repo_name" sudo git svn clone --shared --preserve-empty-dirs --authors-file=users.txt file:///programs/svn/$repo_name sudo git clone --bare /programs/git/$repo_name $repo_name.git sudo chown -R www-data:www-data $repo_name.git sudo rm -rf $repo_name done &lt;"$file" </code></pre> <p>list.txt has the format</p> <pre><code>repo1_name repo2_name </code></pre> <p>and users.txt has the format</p> <blockquote> <p><code>(no author) = Prince Rogers &lt;prince.rogers.nelson@payesley.park.org&gt;</code></p> </blockquote> <p>www-data is the Apache web server user, permission is needed to push changes over HTTP</p> <br /><br /><br /><h3>回答14:</h3><br /><p>First, <code>backup</code> your existing repo:</p> <pre><code>(a) mkdir backup (b) cd backup (c) git clone non_bare_repo </code></pre> <p>Second, run the following:</p> <pre><code>git clone --bare -l non_bare_repo new_bare_repo </code></pre> <br /><br /><br /><h3>回答15:</h3><br /><p>Oneliner for doing all of the above operations:</p> <pre><code>for i in `ls -A .`; do if [ $i != ".git" ]; then rm -rf $i; fi; done; mv .git/* .; rm -rf .git; git config --bool core.bare true </code></pre> <p>(don't blame me if something blows up and you didn't have backups :P)</p> <br /><br /><br /><h3>回答16:</h3><br /><p>Wow, it's simply amazing how many people chimed in on this, especially considering it doesn't seem that not a single on stopped to ask why this person is doing what he's doing.</p> <p>The ONLY difference between a bare and non-bare git repository is that the non-bare version has a working copy. The main reason you would need a bare repo is if you wanted to make it available to a third party, you can't actually work on it directly so at some point you're going to have to clone it at which point you're right back to a regular working copy version.</p> <p>That being said, to convert to a bare repo all you have to do is make sure you have no commits pending and then just :</p> <pre><code>rm -R * &amp;&amp; mv .git/* . &amp;&amp; rm -R .git </code></pre> <p>There ya go, bare repo.</p> <br /><br /><p>来源:<code>https://stackoverflow.com/questions/2199897/how-to-convert-a-normal-git-repository-to-a-bare-one</code></p></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/git" hreflang="zh-hans">git</a></div> <div class="field--item"><a href="/tag/version-control" hreflang="zh-hans">version-control</a></div> <div class="field--item"><a href="/tag/git-clone" hreflang="zh-hans">git-clone</a></div> <div class="field--item"><a href="/tag/git-bare" hreflang="zh-hans">git-bare</a></div> <div class="field--item"><a href="/tag/git-non-bare-repository" hreflang="zh-hans">git-non-bare-repository</a></div> </div> </div> Mon, 25 Nov 2019 15:19:40 +0000 拟墨画扇 10139 at https://www.e-learn.cn