On Tue, 29 Dec 2015 03:14:46 -0800 (PST)
Timothy Murphy <timothygayleardmur...@gmail.com> wrote:

> I've never used git,
> and I want to install it on my CentOS home server,
> to use with a personal project in LaTeX.
[...]
> Here are a couple of questions that I have:
> Is there any standard or semi-standard location for git on a server?

No, there isn't.
But fear not -- I'll suggest you the most simple approach possible.

> Am I right in thinking I have a base directory .../git/
> and a subdirectory of this for each project?

Git is absolutely not concerned with how you organize your repositories.
Such hierarchy (or lack of it) may be required for certain ways of
serving Git repositories -- say, via a web server.  But in your case
the approach most probably can be simpler.

Do you have SSH access to that home server?
I supposed you are.

Then `yum install git` there, and having done that SSH to your server
as a regular user (that is, not root), and create a *bare* Git
repository anywhere under your home directory.
Say, something like this:

  $ ssh homeserver
  ... there:
  % mkdir ~/devel
  % git init --bare ~/devel/my-latex-proj.git
  ... now log out.

Then on your laptop go to your LaTeX project and do:

  $ mv project-20151213.tex project.tex
  $ git init .
  $ git add project.tex
  $ git commit -m "Add project files"

  ... and now deal with the backup repo on the home server:

  $ git remote add origin ssh://homeserver/~/devel/my-latex-proj.git
  $ git push -u origin master

That's basically all there is to it.
Whenever you do changes in your laptop, you commit them and when you're
ready to send them to the backup repo on your home server you do

  $ git push origin master

> I take it I can then clone the project to anywhere I choose
> on my laptop-client?

Well, yes, but pay close attention that *initially* it's the reverse:
you turn your existing project into a Git-enabled project, then create
an (empty) Git repository on your home server and then push from your
local repository to that one on the server.  Having done that, you of
course are free to clone that home server repository at will.

Just in case, keep in mind that you do not actually need a repository
on your home server to work with Git, so it will mostly serve for
backup purposes (and may be facilitate obtaining it to other machines
you're working on).

If you have questions to clear up, don't hesitate to ask them.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to