[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using git



On Tue, Jan 28, 2020 at 02:14:05PM +0000, mick crane wrote:
> On 2020-01-28 13:47, tomas@tuxteam.de wrote:
> >On Tue, Jan 28, 2020 at 01:29:10PM +0000, mick crane wrote:
> >>hello,
> >>I want to install Git locally, I've cloned something before but I
> >>don't know much about it.
> >>Before I dive into the man pages could I ask if I need the
> >>git-daemon-run for the server bit?
> >
> >Not necessarily. Describe your use case a bit more precisely.
> 
> I tried to do bits of programming before and kept the changes in
> directories on the same machine which doesn't always seem to work if
> go back to it after several months. I thought Git on a separate
> machine might help to keep track of things.

My advice: start without a "separate machine". This complicates
things quite a bit, for no (initial) benefit.

You can add the "separate machine" thingy later. It will become
important when you work in concert with others (which includes
your one instance working with other instances of yourself).

But that is Step Two.

Step one would be to set up your "global" git configuration
(i.e. things which hold for you, the user of git). Follow
along

  https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup

Set up a small test repository (local), which is a project
directory the way you're used to, cd into that, then say

  git init
  git add .
  git commit -am "Initial commit"

and you are started. All files below your repo are now
registered for version control, every time you make a
set of changes belonging together, just do

  git commit -am "Redefined every grey elephant to be pink"

(or whatever description will be understandable by you
two weeks from now).

Whenever you create a new file you want to include in
the version control, you do

  git add my-dir/my-new-file

or something.

Then refine things. Learn about what to do when you don't
want some files under version control. Learn how to branch
(a very powerful, but at first confusing concept).

Now learn how to clone a repository (still on your local
machine!).

Next step would be to learn how to clone a remote repository.
Open one for you to play on e.g. gitlab (I'd steer clear of
github these days, but, of course, it's *your* decision).

And then, once you feel somewhat comfy with all of the above,
you're at the place where things like the git daemon and its
friends might be interesting to you.

Cheers
-- tomás

Attachment: signature.asc
Description: Digital signature


Reply to: