[M3devel] getting started with git?

Rodney M. Bates rodney_bates at lcwb.coop
Wed Dec 10 15:29:29 CET 2014


I'm pretty new at git too, so my impressions are tenuous

On 12/10/2014 06:20 AM, Jay K wrote:
> I have been struggingly to do anything with git.
> Just me?
> Please help?
>
>
> I understand that everyone gets a copy of the repository, so viewing history
> is fast and disconnected.
>
>
> I understand I get to commit locally so that I can commit willy nilly and nobody
> will notice or mind.
>
>
> I understand that after I commit locally willy nilly, I can "combine" many
> small commits into one commit, so that when eventually my changes are shared,
> while the history might be hierarchical/branched, it won't be too noisy.
>

Hmm, I haven't read about anything like this.  What are the commands to do it?
The only thing I have done is to push to github, which puts all of my separate
local commits into github, all separate there too,, not aggregated.

>
> Those are all good selling points.
>
>
> Now, things I don't understand.
>
>
> Besides my local repository, is github also hosting a fork just for me?

This is not my understanding.  I think github has just one repository, which
periodically gets your changes added when you push to it.

>
>
> I commit to that "somewhat willy nilly"?
> This seems like a somewhat redundant extra layer.
>
>
> And then, "third level of the hierarchy", occasionally my github
> repository is merged with the master?
>

Perhaps you are referring to having your own branch.  If you create
a branch locally, then push that branch, the central repo also gets
a copy of the branch, with all its history.  The branch name is an
operand of the 'push' command, probably defaulting to 'master' if
omitted.

'master' is the name of the initial branch, and you can merge any other
branch into it.  This works the same within your local repo or within
the guthub one.  I think the right procedure would be to merge your branch
into 'master', all locally, fixing any problems there.  Then push your
local, now-merged master to github.  (And, just for backup/completeness,
probably also push your branch to github too.)

I think you could alternatively push your branch to github, then, in github,
merge the branch into 'master' there.  This would probably make the
github repo temporarily difficult/impossible for others to use, if
there were any merge conflicts.  Seems like a bad procedure.
(Or, does git precheck for conflicts and refuse to carry out the
merge until they have been fixed?)  After that, you'd still need to
pull master from github, to get the merged changes back into your
local repo.

>
> I submit a pull request?
> I haven't figured out how.

'pull' is a git command you can issue locally, naming the remote
repo (and the branch) you want to pull from.  With the remote repo URL
omitted, it pulls from the one you originally cloned from.  That is
remembered somewhere locally.  You can examine/edit the URL with some
command, I think 'remote'. (push defaults to this URL too.)

What I have been unable to do is get an explicit repo URL in
a pull or push command to work.  Every spelling I try either silently
and immediately returns a prompt, with no evidence anything happened,
or gives a error message criticizing the repo URL as if it were supposed
to be a branch name or something other than a URL..

> And who handles them?
> Or it is automatic? But how to stop arbitrary edits then?

I am quite certain it is not automatic.  You have to explicitly pull.

Somebody else with their own local repo can push it to yours, but you
have to have given them permission somehow.  I doubt the github repo
will ever get pushed to yours.

> i.e. how to approve people?
>
>
> There is more I don't understand.
> Like, in CVS and Perforce I am accustomed to multiple clients/checkouts/enlistments,
> for separate work, or for "buddy builds".
>
>
> But that shouldn't require a whole additional repository full of history.
>
>
> What is the analog in Git?
>
> Alternatively, can some write up the following workflows:
>
>   1. start from scratch
>   2. get a file edited in the mainline
>   3. and then undone
>
>   1. start from scratch
>   2. get a file added in the mainline.
>   3. and then edited
>
>
> So much documentation talks about tangential scenarios, like "git init" which I don't think is relevant.
>
>   also, I find git status is quite slow.
>   So much for offline and disconnected.
>   Is there a mode where, like:
>     1) files are read only by default
>     2) I have to run git to make them writable
>     3) It will remember, quickly?
>
> I am thoroughly familiar with and happy with perforce, so explanations
> that attempt to compare/contract/reuse-vocabulary with it are welcome.
>
>
> Thanks,
>   - Jay
>
>

-- 
Rodney Bates
rodney.m.bates at acm.org



More information about the M3devel mailing list