Re: [Dorset] Downloading Code from Github

2017-07-23 Thread Patrick Wigmore
On Sunday, 23 July 2017, at 16:50:40 BST, Terry Coles wrote:
> Is there a 'proper' way to grab a copy of a program from Github
> without making a Pull Request?

In git terminology, there exist both pulls and pull requests, 
which are different things.

If you issue a pull request, you are asking somebody else to 
"pull" your changes into their local repository.
Whereas, if you do a pull, that would be you pulling changes into 
your local repository.

It's confusing that these are so similarly named, if you ask me. 
Lots of students on my degree course were tripped up by that when 
first introduced to git.

My beginner's understanding is that you need to "clone" the 
repository; that is, make a local copy of the repository, which 
is then managed by the git(1) program on your machine. You would 
do this using the git-clone(1) command in a terminal, or some 
equivalent in a GUI frontend to git.

Having created your local repository, you can use it as a working 
directory for development, testing, debugging and so on, and use 
git commands to manage it and track changes locally.

I suspect that git is something that different teams and projects 
will have different ways of using. But in any case, at some point 
you will reach a stage where you or your team feel that the 
changes you've made are (a) worth keeping and (b) at some 
sensible juncture where it makes sense to record the changes. At 
this point, you would make a commit, and give it a useful 
description, using git-commit(1).

Commits represent a snapshot of the contents of the repository, 
and initially exist only locally. They derive from previous 
commits, and are in principle (somewhat) immutable, so that when 
you push them to another repository, they fit nicely into the 
existing graph that contains the commits upon which they were 
based.

Having made one or more commits locally, you can "push" them from 
your local repository to the remote repository, or "pull" them 
the other way if somebody else made a change (or sent you a pull 
request). Predictably, the commands are git-push(1) and git-
pull(1). I think of this as synchronising the graph of commits 
between the different copies of the repository, though I suspect 
there are subtleties that this mental model ignores.

git(1) doesn't inherently enforce a single, central, remote 
repository; you could just as well be pushing and pulling between 
several distributed repositories in some other topology. However, 
the commonality between the different possible topologies seems 
to be that all the repositories share the same graph of commits.

I suppose different projects probably have different policies or 
conventions for when and in what manner to push, pull, issue pull 
requests, and whatever other tricks git has up its sleeve that 
I've not yet discovered.

Other things that seem important to read the manual on include:
git-checkout(1)
git-branch(1)
git-merge(1)

My understanding of these is weak, so I won't attempt to explain 
them myself, but I recall having to read about them in order 
reach my current understanding of git.

I expect somebody with more git experience can answer your 
questions more precisely and concisely, but hopefully my 
meandering beginner's perspective is also useful.


Patrick

-- 
Next meeting:  Bournemouth, Tuesday, 2017-08-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Downloading Code from Github

2017-07-23 Thread Ralph Corderoy
Hi Terry,

> Is there a 'proper' way to grab a copy of a program from Github
> without making a Pull Request?

A Pull Request is not you wanting to pull, it's a request to the other
party to pull from you, i.e. you've commits they haven't got.

> Previously, I've downloaded the whole repository and just grabbed the
> code I wanted

Yes, do that.  git-clone(1) their repo.  You can --depth=1 if you want
to get a shallow repository that lacks history if their repo is huge;
less disk space, faster transfer.

> but I always believed that you only 'checked-out' a file if you
> intended to change it.

It's not that precisely defined, and many other systems use it to just
mean get a copy, e.g. co(1), that stands for `check out' and is part of
RCS, does a check out that's either with an exclusive lock, -l, or
unlocked, -u.

https://help.github.com/articles/cloning-a-repository/ may be useful.
You can clone someone else's repo as well as your own.

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-08-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Downloading Code from Github

2017-07-23 Thread Terry Coles
Hi,

Is there a 'proper' way to grab a copy of a program from Github without making 
a Pull Request?

Previously, I've downloaded the whole repository and just grabbed the code I 
wanted, or read the file Raw and done a Save-as.  Is there another way? I've 
always avoided making a Pull Request because I didn't intend to change the 
file, just use it, eg to try it out.

(Also, in the past I've not had sufficient access to the repository to do a 
Pull 
anyway, but now I do.)

I want to get hold of a copy of a program recently committed by one of the WMT 
team to test it on the hardware.  Clearly if there is something wrong with the 
code, I might want to Pull it to fix the problem, but equally, I might want to 
raise it as an issue.

My experience of Source Control Systems is limited to two; SourceSafe on 
Windows and DSEE on HPUX thirty odd years ago, but I always believed that you 
only 'checked-out' a file if you intended to change it.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-08-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR