git and github intro - & -
GitHub Help - & -
Think Like (a) Git
August 12th, 2015/4:06am
Things you find... the .git
repository is supposed to be in the 'root' dir of the project. -But- Google/Cyanogen has moved it,
(see beginning above)
so I do believe that is the reason I have gotten the errors in the following.
We have decided to place our "references" to our newly acquired info, and
knowledge of, this GitHub... here in our "references" to info, and knowledge of,
Dsixda's Android Kitchen. Since we will probably be using them together anyway. Both of these have
been set up in our openSuSE 12.3 System.
Now then, some may say that they are NOT used together. Wellll... that all depends on how you look at it. We are trying to
learn more about the Android System -but- also -and- more importantly our
HTC
ReZound.
We have contacted various individuals concerning this phone -and- the use of the software. We have tried to recognize ALL of those who have helped,
and hope we have not missed any. IF you see something that you think you should have credit for, and haven't, please let us
know.
#0) /usr/lib/git/git-gui Included with openSuSE install... IF you select it.
And a tour...
(this tour is Windows oriented, mine is Linux oriented. Man Page is both.)
The Man Page
April 18th, 2014/1:17am Alllllrighty now... this git-gui is entered on the command line
as "git gui". Notice that the dash '-' is missing. On our system it produced the followng:
Clicking on the "Open Recent Repository" parameter entry produced:
In -or- out of the proper dir of "~/Android/cm11.0-rezound" or "~/Android/cm11.0-rezound/android".
IT chose the "~/Android/cm11.0-rezound/android". Why?? I don't know ... yet. More on this 'gui' as
we continue. Well, actually right now cause of the following error(s)!!
Instead of clicking on "Open Recent Repository", we click on "Open Existing Repository" which
produced:
We clicked on "Browse" and got:
We selected the default and got: (we had previously moved into the proper dir.)
which is rather strange, since we have been creating and compiling from this dir for the past couple of months. It was supposed to be
a clone of the one our "OnLine".
OK... learn new things all the time.
ANDROID_BUILD_TOP is the container for your projects, which in this
case is ~Android/cm11.0-rezound, and it does NOT get a "git init". So it will NOT be a "git repository".
#1) The Git code was installed through
the Yast2 installer... because... it was/is part of the openSuSE
distribution. As usual, the Author used some other system with 'apt' and 'get' commands. The following is our initial "setup".
Note: Quote from:
Stack Overflow
When creating a commit with Git, it uses the configuration values of user.name
(the real name) and
user.email
(email address). Those config values can be overridden on the console by setting and exporting the
environment variables GIT_{COMMITTER,AUTHOR}_{NAME,EMAIL}
.
Git doesn't know anything about GitHub's users, because GitHub is not part of Git.
#2) Now then, we had searched for info and found
How to Use GitHub
and blindly followed the directions ... and then got stumped. Not necessarily cause of the information on the page -but-
because we didn't understand it enough and there wasn't quite enough info. Think the writer expected the reader to know
more than they -or we- do. Anywho, the very first command assumes that you are using
Ubuntu -or- Debiian. We were/are not. Therefore, we installed
the Git that came with our openSuSE distribution.
(repeat??)
Another Note: Be careful following tutorials... even this one.
You may get things setup -- that you really don't want setup. A "git init" at the wrong place can be quite strange. Yeah,
we followed blindly on some things -and- that is the reason for this warning.
MAKE SURE that you are in the "correct directory" BEFORE you do a "git init".
And you do NOT use this in the ~Android/cm11.0-rezound dir. That is only a Top Level Container.
git version This will, naturally,
display the version of Git that you have installed on your system. The version that we got with our
openSuSE was/is: git version 1.8.1.4
git config --global user.name "Your Name Here"
git config --global user.email "your_email@youremail.com"
Now then, the first item in demo, as we
have already mentioned, was the install of Git. The second was these two
commands. We executed the first and 'nothing' obvious happened. We later found that it created a file in our home dir --
.gitconfig file -- and the contents of it was:
[user]
name = Chuck Txxx
Now the above was a direct listing of the file. ie; 'less .gitconfig'
December 9th, 2013/12:31pm Ok now, things can, and will, get
interesting ... as we learn. The above info was -before- we Re-Installed our opeSuSE 12.3 -after-
trying openSuSE 13.1.(Which was a BIG disappointment)
Then we set things up for a CyanogenMod compile. Think that git config was called during those
processes. Consequently, we got another version of the .getconfig file.
To which we will add the above commands which will result in the following:
[color]
ui = auto
[user]
name = Chuck Tayr
email = chucktr--trcompu.xxx
git config --global --list This is the command
to list the contents of that file and it will show:
ctayr@dusty-tr2:~
> git config --global --list
color.ui=auto
user.name=Chuck Tayr
user.email=chucktx--trcompu.xxx
git config --global --unset-all user.name Then we
have the removal. This will remove the user -but- when you add them -or- another back in it leaves a blank for the former. Another 'dump' of
the file showing our 'playing' with the add and delete operations.
[user]
[user]
[user]
name = Chuckxx
Now then, in the 'other' author's defense we do believe that he was expecting us to be
on "GetHub.com" and signing up. The 'Home' page
has the following on it:
But then, we also want to set things up on our own system -and- we do believe that info should be present -and-
probably the same. We created the file 'locally' and used our Full name and our gmail address with the following commands:
git config --global user.name "Chuck Tayr"
git config --global user.email "chuckxxxx@gmail.com"
The list command git config --global --list then
shows:
user.name=Chuck Tayr
user.email=chuckxxxx@gmail.com
We are not showing our 'actual' address cause some will use it maliciously. But we think you get the idea.
In addition we are using our Gmail address cause... it seems that Google is connected in all this... somewhere.
Now then, from Bootcamp / Set Up Git
we get
git config --global credential.helper cache
which is going to set things up to hold our username and password so we don't have to enter it all the time. Only thing is...
we don't have a password yet!! What's more we get:
Congratulations, you now have Git and GitHub all set up! What do you want to do next?
Well the Git is on our PC -but- where is the GitHub???
Where/Who am I??? - December 18th, 2013/8:17am To check your git setting, run this command:
git config user.email -or-
git config user.name
To get to your Account Settings,
you will use one of the above -and- a password. Now then, IF you don't know your password... then you haven't set up an Account. The only
other thing would be that you have forgotten it and there are provisions for that.
At 11:40am We joined GitHub. Well, we created our Account. We had to use
chuckxx for our username. Normal Email address, normal password and we'll get Public Repos.
We enquired and got the following answer about the names:
Your GitHub username is different to the full name you use to author commits. Your username will be used to represent
your profile on GitHub:
https://github.com/<username>
In other words you have two usernames. One your full name and the other one that you make up.
Further Info on 'Where' Created.
Added December 21st, 2013 TRComputing
Questions from us; Answers from them(Petros)
-And- later remarks from us.
> First, what I would like to do is --- Set up a GitHub on my Personal Computer.
My Machine. Is that possible?? Or are they only on the Internet??
github.com is a cloud service and you can't install it locally. What you should install is the Git client,
(or any Git client) because you need that to be able to work with Git repositories, which is what GitHub is based on.
> Second, Can I copy a GitHub that is on the Net to my machine??
If you are referring to a Git repository, yes, and this is the essence of working with Git repositories.
You have to clone them locally.
Duhhh... I was a squeaky clean 'noob'. You get exactly what is 'out' there onto your machine. In this case,
the complete source code directory structure with all the code. You get to make changes and play with it ... 'Locally'.
> Third, Can I have it in both places??
If you are referring to a Git repository, yes, you have one on github.com and then anyone with access
can clone it locally and start working on it.
Let us know if you have more questions.
Cheers,
Petros
Annnnddd... now with 'some' knowlege I am realizing how silly the above questions were. -But- on the
other hand... IF you don't know until you ask.....and use it.... And then it becomes obvious!!
Added January 27th, 2014 TRComputing
Now we got ourselves totally cornfused and decided to ask. We presented our questions to
_litz:
Mr _litz,
I/we am/are trying to learn this as quick as possible -before- all of you move on.
My biggest question is how the sources are coordinated. Yes, I know there are
tutorials and descriptions -but- I thought a couple of questions answered could
help get me started faster.
Now in working with this, we have found that the following directory structure is created:
ctaylor@dusty-tr2:~/Android
> lsd cm11.0-rezound/
abi/ CherryPick-1-11-14.txt FixRepo-1-12-14.txt libcore/ prebuilts/
android/ cherrypick.sh* FixRepo-1-14-14-2.txt libnativehelper/ sdk/
AndroidNotes.txt* cherryresult.txt FixRepo-1-14-14.txt Makefile* system/
art/ cts/ fixrepo_litz.sh* make.sh* tools/
bionic/ dalvik/ fixrepo.sh* MemNote.txt vendor/
bootable/ developers/ frameworks/ ndk/ vigor/
build/ development/ hardware/ out/
Build-1-11-14.txt device/ InitRepo-1-11-14.txt packages/
build.err docs/ initrepo_hybrid.sh* pdk/
build.log external/ kernel/ prebuilt/
ctaylor@dusty-tr2:~/Android/cm11.0-rezound
> lsd .repo
local_manifests/ manifests/ manifests.git/ manifest.xml project.list projects/ repo/
Now then, there are 'extra' entries in the directory that we have displayed above. Because of 'failures',
we had to make some test runs and save the results. The entries in Red are extras. And finally
our question was:
Now then, how much of the above is from the CM Team and how much of it needs to be modified for
the ReZound?? Is it just the "vigor" dir?? I would like to be able to do what Neo, Flyhalf
and you are doing. Update the Rez to the latest CM ... on my own. Don't expect you to tell me
everything, but hopefully point me in the proper directions. There is a "key" or "spark"
that I am missing and once that is gained I know that I will be able to continue. You know,
there is always something that all of a sudden says, "OhYeah!! That's how it works!!"
To which
_litz
replied: (His comments in green)
Ahh, that's the magic of "repo" ...
Look in the .repo directory. Notice the '.' this makes it a hidden dir.
In there, you'll see a manifest.xml file. This contains all the projects supplied by CM.
When examined, you'll find that all the dirs listed are projects.
This is generated by the repo init command, using CM's android.git file and selecting the "cm-11.0" project
in the repo init command line. In our case this is inside the initrepo_hybrid.sh performed in step 10 down below.
e.g. : repo init -b cm-11.0 -u git://github.com/CyanogenMod/android.git
You'll also note, there is a directory called local_manifests, and inside this directory is local_manifests.xml.
This is the directory (and file) that contains all the device specific projects. In our case, everything
specific to "vigor".
This is downloaded either directly by the user and placed in place, or the "initrepo.sh" script achieves the same
thing via wget and some other shell commands.
e.g. : wget https://raw.github.com/vigor/android...est_hybrid.xml
(in the case of initrepo.sh, it grabs the above file, then renames it to "local_manifest.xml")
If you have done this before the repo init command, repo will automatically grab manifest.xml, and then use BOTH
manifest.xml and local_manifest.xml to download and maintain all the required projects ... both CM's and the
device specific projects in local_manifest (e.g., all our vigor projects).
Now, as for the "vigor" specific items ... if you look inside the local_manifest.xml file,
you'll see each project listed line by line.
"path=" tells where in the source tree the project is to be placed
"name=" is the actual name of the project (github and repo use this)
"revision=" is the branch of the project. In our case, in vigor, it's either "cm-11.0" or "cm-11.0_hyrbid".
revision merely denotes which actual "tree" of code to use. There are trees for each version of cm (9, 10, 11. etc),
for instance.
- litz
Now the above in NOT meant to replace, or supplant, any of the excellent documentation already
available on Git and GitHub. This is just to get us started... on the ReZound
in particular. Anything NOT in green is 'my' wording and 'my' way of understanding.
Added September 15th, 2013 TRComputing
Well, the next item in
Bootcamp is...
Create A Repo. We find the same words at the top of the Web Page:
If you've found yourself on this page, we're assuming you're brand new to Git and GitHub. This guide
will walk you through the basics and explain a little bit about how everything works along the way.
Well, it is true... we are new and trying to learn. So, let's follow along.
Checking Your Settings
If you want to check your settings, you can use the git config --list
command to list
all the settings Git can find at that point. We changed from our home dir to the AndroidSDK dir we
created earlier and the command listed the items in our ~/.gitconfig file in our home dir.
Refer: Getting Started
> git config --list
color.ui=auto
user.name=Chuck Tayr
user.email=chuckxx@trcompu.xxx
credential.helper=cache --timeout=3600
gui.recentrepo=/home/ctayr/Android/cm11.0-rezound/android
gui.recentrepo=/home/ctayr/Android/cm11.0-rezound/device/htc/vigor
Giggle
- Giggle (homepage) is a graphical frontend for browsing history
of Git repositories (think of gitk on GTK+). Result of a Hackathon 2007, later developed by Imendio's Carlos
Garnacho and Sven Herzberg and then by Mathias Hasselmann. Currently maintained by the GNOME community.
Available from http://git.gnome.org/browse/giggle/
Comments
giggle