Git repositories: Difference between revisions

From wikinotes
No edit summary
 
Line 14: Line 14:
git init
git init
</source>
</source>
</blockquote><!-- creating a repo -->
</blockquote><!-- creating a repo -->
= Git Transfer Protocols =
<blockquote>
Git can communicate using a variety of protocols. Personally, I like using ssh best since it is secure,
universal, and I'm already using it.
== ssh ==
<blockquote>
First, create a git repo on a server that is accessible using ssh. See [[openssh]] .
Next, add a git remote to your project referring to it using the ssh protocol.
<source lang="bash">
git remote add origin ssh://git@gitbox:8610/home/git/my_project
git --set-upstream origin --all
git push
</source>
Technically, this is all you need. It would be prudent to create a <code>git</code> user
with minimal privileges, and configured to use <code>git-shell</code> (which allows pull/push only).
</blockquote><!-- ssh -->


= Special Cases =
= Special Cases =
<blockquote>
<blockquote>
== Verify ==
== Verify ==
<blockquote>
<blockquote>

Latest revision as of 04:05, 5 February 2022

Creating a Repo

creating a repository (to be synchronized to/from)

cd /path/projectname
git init --bare

create a project (to work in, push/pull from repo)

cd /path/projectname
git init

Special Cases

Verify

git fsck    ## check that repo is not corrupt

Large Files

The git repo also reads ~/.gitconfig, and if you are experiencing issues cloning large files, it can be helpful to perform the following on the server, and if that does not help, on the client as well.

#### ~/.gitconfig
[pack]
    windowMemory = 1000m
    SizeLimit = 1000m
    threads = 1
    window = 0