Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #208730 > unrolled thread

using git locally

Started bymick crane <mick.crane@gmail.com>
First post2019-05-17 15:40 +0200
Last post2019-05-17 17:30 +0200
Articles 8 — 5 participants

Back to article view | Back to linux.debian.user

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  using git locally mick crane <mick.crane@gmail.com> - 2019-05-17 15:40 +0200
    Re: using git locally Greg Wooledge <wooledg@eeg.ccf.org> - 2019-05-17 16:00 +0200
      Re: using git locally mick crane <mick.crane@gmail.com> - 2019-05-17 16:40 +0200
        Re: using git locally Eduardo M KALINOWSKI <eduardo@kalinowski.com.br> - 2019-05-17 17:00 +0200
          Re: using git locally Jude DaShiell <jdashiel@panix.com> - 2019-05-17 17:40 +0200
          Re: using git locally mick crane <mick.crane@gmail.com> - 2019-05-17 20:10 +0200
    Re: using git locally Brad Rogers <brad@fineby.me.uk> - 2019-05-17 16:10 +0200
      Re: using git locally mick crane <mick.crane@gmail.com> - 2019-05-17 17:30 +0200

#208730 — using git locally

Frommick crane <mick.crane@gmail.com>
Date2019-05-17 15:40 +0200
Subjectusing git locally
Message-ID<xYLfz-8tk-5@gated-at.bofh.it>
hello,
Because I am always making mistakes I thought, if it's not too hard, to 
see about using git locally.
I made a git repository for project following destructions
https://www.digitalocean.com/community/tutorials/how-to-use-git-effectively
but I'm having bother accessing it remotely.
I can ssh from one pc to another using keys with key phrase.
"ssh mick@server"
but
"git remote add origin ssh://mick@server/home/mick/git/camera"
and many variations I get.
fatal: not a git repository (or any of the parent directories): .git
I'm not really understanding the difference between "ssh" and "ssh://" 
except "ssh" works in terminal and "ssh://" doesn't.
Is it ssh:// that is wrong or I've failed to get the syntax right for 
git ?
mick
-- 
Key ID    4BFEBB31

[toc] | [next] | [standalone]


#208731

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2019-05-17 16:00 +0200
Message-ID<xYLyW-8r-9@gated-at.bofh.it>
In reply to#208730
On Fri, May 17, 2019 at 02:36:36PM +0100, mick crane wrote:
> Because I am always making mistakes I thought, if it's not too hard, to see
> about using git locally.

If that is literally all you want to do, then you don't need to set up
a "repository".  You have your project, sitting in a directory.  You can
turn that directory into a git-managed directory and use "git commit"
and so on right inside it, without ever pushing or pulling or remoteing
or origining or any other stuff where your directory is linked to some
outside entity.

> I made a git repository for project following destructions
> https://www.digitalocean.com/community/tutorials/how-to-use-git-effectively
> but I'm having bother accessing it remotely.

Digital ocean is not exactly the first choice here.

The official Git documentation, in particular chapter 4
<https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols>

would probably be a better starting point.

> I can ssh from one pc to another using keys with key phrase.
> "ssh mick@server"
> but
> "git remote add origin ssh://mick@server/home/mick/git/camera"
> and many variations I get.

If you really *did* create a git repository on a remote server, and
you want to clone it onto your local PC, you use a "git clone" command.

Something like:  git clone my.server:/whatever.git

[toc] | [prev] | [next] | [standalone]


#208735

Frommick crane <mick.crane@gmail.com>
Date2019-05-17 16:40 +0200
Message-ID<xYMbD-B4-5@gated-at.bofh.it>
In reply to#208731
On 2019-05-17 14:56, Greg Wooledge wrote:

> 
> If you really *did* create a git repository on a remote server, and
> you want to clone it onto your local PC, you use a "git clone" command.
> 
> Something like:  git clone my.server:/whatever.git

well that seems to work
"git clone myserver:/path_to_git_repository"
whereas
"git remote add origin myserver:/path_to_git_repository"
fatal: not a git repository (or any of the parent directories): .git

probably I can worry about that later at least I know now I can talk to 
it.

mick
-- 
Key ID    4BFEBB31

[toc] | [prev] | [next] | [standalone]


#208737

FromEduardo M KALINOWSKI <eduardo@kalinowski.com.br>
Date2019-05-17 17:00 +0200
Message-ID<xYMuZ-I7-1@gated-at.bofh.it>
In reply to#208735
On 17/05/2019 11:31, mick crane wrote:
> well that seems to work
> "git clone myserver:/path_to_git_repository"
> whereas
> "git remote add origin myserver:/path_to_git_repository"
> fatal: not a git repository (or any of the parent directories): .git
>
> probably I can worry about that later at least I know now I can talk
> to it. 

That's because git remote add is meant to add a remote to an existing
git (local) repository. You're probably running it on an empty
directory, so it complains (correctly) that you're not in a repository.

If you really must, do "git init ." and then "git remote add". But just
use clone to create the local repository based on another repository.

-- 
The Marines:
	The few, the proud, the not very bright.

Eduardo M KALINOWSKI
eduardo@kalinowski.com.br

[toc] | [prev] | [next] | [standalone]


#208742

FromJude DaShiell <jdashiel@panix.com>
Date2019-05-17 17:40 +0200
Message-ID<xYN7I-1aX-7@gated-at.bofh.it>
In reply to#208737
This comes from David Karl Oliver who is no longer among the living.
Marine: Muscles are required intelligence not expected.  His cousin
joined the Corps too and David Oliver and me worked as civilians for the
Navy in the same office.

On Fri, 17 May 2019, Eduardo M KALINOWSKI wrote:

> Date: Fri, 17 May 2019 10:59:36
> From: Eduardo M KALINOWSKI <eduardo@kalinowski.com.br>
> To: debian-user@lists.debian.org
> Subject: Re: using git locally
> Resent-Date: Fri, 17 May 2019 14:59:53 +0000 (UTC)
> Resent-From: debian-user@lists.debian.org
>
> On 17/05/2019 11:31, mick crane wrote:
> > well that seems to work
> > "git clone myserver:/path_to_git_repository"
> > whereas
> > "git remote add origin myserver:/path_to_git_repository"
> > fatal: not a git repository (or any of the parent directories): .git
> >
> > probably I can worry about that later at least I know now I can talk
> > to it.
>
> That's because git remote add is meant to add a remote to an existing
> git (local) repository. You're probably running it on an empty
> directory, so it complains (correctly) that you're not in a repository.
>
> If you really must, do "git init ." and then "git remote add". But just
> use clone to create the local repository based on another repository.
>
>

-- 

[toc] | [prev] | [next] | [standalone]


#208752

Frommick crane <mick.crane@gmail.com>
Date2019-05-17 20:10 +0200
Message-ID<xYPsS-2KH-9@gated-at.bofh.it>
In reply to#208737
On 2019-05-17 15:59, Eduardo M KALINOWSKI wrote:
> On 17/05/2019 11:31, mick crane wrote:
>> well that seems to work
>> "git clone myserver:/path_to_git_repository"
>> whereas
>> "git remote add origin myserver:/path_to_git_repository"
>> fatal: not a git repository (or any of the parent directories): .git

> That's because git remote add is meant to add a remote to an existing
> git (local) repository. You're probably running it on an empty
> directory, so it complains (correctly) that you're not in a repository.

Oh I see, thought message was about the other end.
thanks
-- 
Key ID    4BFEBB31

[toc] | [prev] | [next] | [standalone]


#208733

FromBrad Rogers <brad@fineby.me.uk>
Date2019-05-17 16:10 +0200
Message-ID<xYLIC-rj-11@gated-at.bofh.it>
In reply to#208730

[Multipart message — attachments visible in raw view] — view raw

On Fri, 17 May 2019 14:36:36 +0100
mick crane <mick.crane@gmail.com> wrote:

Hello mick,

>Is it ssh:// that is wrong or I've failed to get the syntax right for 
>git ?

I'm no expert on git, so ask me questions - I probably won't be able to
answer them anyway.   :-)

That said, this might help:-

https://stackoverflow.com/questions/28827831/how-to-setup-git-on-local-network

The relevant part appears to be:

---------Quote---------------------------
Basically, you'll want to use git daemon. If you just need to set up a
single repository, that's one line from each machine:

Server:

git daemon --base-path=/path/to/repo --export-all

Client:

git remote add LocalServerName git://<serveraddress>/

where <serveraddress> is some reference to that machine (IPv4, IPv6,
.local, etc.). You can also specify --verbose for the daemon command for
more detailed output.

I think, also, you could have --base-path point to a folder with many
repositories, and that would let you specify which project you wanted on
the client-side like so:

git daemon --base-path=/path/to/all/repos

git remote add ServerName git://<serveraddress>/MyProject/

Be advised: using --export-all will let any computer on the network pull
from your repo.

-----------End Quote---------------------

-- 
 Regards  _
         / )           "The blindingly obvious is
        / _)rad        never immediately apparent"
Everything in life should be free, except the bits that belong to me
Selfish Rubbish - Public Image Ltd

[toc] | [prev] | [next] | [standalone]


#208739

Frommick crane <mick.crane@gmail.com>
Date2019-05-17 17:30 +0200
Message-ID<xYMY1-17B-1@gated-at.bofh.it>
In reply to#208733
On 2019-05-17 15:05, Brad Rogers wrote:
> On Fri, 17 May 2019 14:36:36 +0100


thanks
-- 
Key ID    4BFEBB31

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web