How to use Git

User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

How to use Git

Post by DGDanforth »

This discussion is for questions and answers about the software control system called 'Git'
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: How to use Git

Post by DGDanforth »

My first question is: "What is a project?"

The Git User Manual assumes you have a project or a clone of a project but does not seem to define what a project is.
It mentions that a project is a collection files but I do not see any mechanism within git gui for adding or deleting 'files' from a project.

This says to me that I am operating with the wrong assumptions about git. What the hell is git?
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: How to use Git

Post by DGDanforth »

"Submitting patches to a project

If you just have a few changes, the simplest way to submit them may just be to send them as patches in email:"

What??!

That's really crude. What is a 'patch'?

"
git format-patch [-k] [(-o|--output-directory) <dir> | --stdout]
[--no-thread | --thread[=<style>]]
[(--attach|--inline)[=<boundary>] | --no-attach]
[-s | --signoff]
[--signature=<signature> | --no-signature]
[-n | --numbered | -N | --no-numbered]
[--start-number <n>] [--numbered-files]
[--in-reply-to=Message-Id] [--suffix=.<sfx>]
[--ignore-if-in-upstream]
[--subject-prefix=Subject-Prefix] [(--reroll-count|-v) <n>]
[--to=<email>] [--cc=<email>]
[--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
[<common diff options>]
[ <since> | <revision range> ]
"

What an utter mess.

Surely there must be a way to 'change' a 'project' by simply adding or deleting a file from the 'project'. How does one do that?
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: How to use Git

Post by DGDanforth »

I seem to have found some decent documentation at

https://github.s3.amazonaws.com/media/progit.en.pdf

I am now reading it.
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: How to use Git

Post by DGDanforth »

I am trying to set the default editor of git to BlackBox but find I need to get down into the Unix mind set and create a configuration file. Something I really wish to avoid!

Look, I have spent about 5 years mucking around with Unix systems, mostly SUN Solaris but a little of IBM aix also.
It is something I really do not want to return to.

I see from the documentation that git was developed by the Linux community to maintain Linux. That explains everything. YUK!
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: How to use Git

Post by Ivan Denisov »

Doug, I understand you. There are easy way to work with Git without terminal window with Git GUI. I will make the instruction with screenshoots here:
http://wiki.blackboxframework.org/index.php?title=Git
User avatar
Josef Templ
Posts: 2048
Joined: Tue Sep 17, 2013 6:50 am

Re: How to use Git

Post by Josef Templ »

The easiest way to work with Git under Windows is to install TortoiseGit.
It is a Windows Explorer extension that works fairly well. It has a long history
as TortoiseSvn, which I have used for many years for SVN under Windows
both for BlackBox and Java projects.
TortoiseGit is a version of Tortoise tailored at the specifics of Git.
Whatever tool you use, make sure to understand Git first by reading one of the many
introductory texts on Git. Git is very powerful and offers many features of which
we probably need only very few. So it is kind of difficult to focus on the right
subset of features.

The single most important point that makes Git very different from older VCSs (such as SVN)
is that is is a distributed VCS. Whenever you download (CLONE) a Git project from the Git server
you create a local copy of of the complete project, thus you get a copy of the complete repository,
which then can be used offline for committing changes. Later on you can
PUSH back the changes to the remote server, if you like.
You can also PULL changes that have been made on the remote server to update
your local repository.
This additional level of indirection is what confuses most beginners.
Only after getting used to this way of work you are able to appreciate the power
and flexibility of systems like Git.

- Josef
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: How to use Git

Post by Ivan Denisov »

Dear members, I made some instruction how to use Git GUI tool and model the situation, that somebody create pull request: https://github.com/BlackBoxCenter/bbcb/pull/1

The changes are described here: http://forum.blackboxframework.org/view ... ?f=40&t=93

I am suggest to vote for apply this pull request taking into the account comment of Josef about function names!
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: How to use Git

Post by DGDanforth »

Josef Templ wrote:Later on you can
PUSH back the changes to the remote server, ...

- Josef
What I don't understand is 'conflict resolution'. If two people make changes to the same file (on their local versions) and then PUSH those changes back to the remote server then who wins? Is there a forced negotiation process that is automated?

-Doug
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: How to use Git

Post by Ivan Denisov »

DGDanforth wrote:What I don't understand is 'conflict resolution'. If two people make changes to the same file (on their local versions) and then PUSH those changes back to the remote server then who wins? Is there a forced negotiation process that is automated?
Before push your commit you should make Remote/Fetch from/origin, if there is a conflict you will get the notification about it and can resolve this conflict manually. For plain text conflict git can make automated merge of files, however for BlackBox odc automated merge is not possible. You can use Dos or F9 for solve conflicts manually.
Post Reply