Jump to content


Photo

USING GITHUB "GIT" [How-To && Getting Started]


  • Please log in to reply
12 replies to this topic

#1 DirtyDroidX

DirtyDroidX

    The Enigma

  • Superuser
  • 60 posts
  • LocationPittsburgh, Pennsylvania
  • Current Device(s):Note 2, Note 8.0, Nexus 7

Posted 26 July 2013 - 10:01 PM

Most Linux-based kernel/general development these days use a form of "version control" (source control, revision control) Basically it will organize and record all changes made to the "source" as a change (comely known as a commit.) Out of all the commands, "git" is the most used commit you will see. Git was designed specifically for Linux development (by the great minds who originally created Linux) and to better organize their changes,commits, etc while collaborating with the Linux kernel. For more info on this see wikipedia. They have a good article..... http://en.wikipedia.org/wiki/Git_(software)
 
Along with "git", we will be using Github as a FREE hosting service for out git repositories"NOW HOW COOL IS THAT"! Github acts like a server for projects using "git". While the site is somewhat geared as a "social" code sharing website, you don't have to be social or even a friendly person or even interact with anyone if you don't want to. (If they let me use it they will let anyone!) For example, it's perfectly fine to use Github as a server for a project that only you or your friends are working on. Basically, it's acting as a remote backup for your code/projects (yes, i do this myself) and it serves one other purpose for us...... It's a super easy way to comply with the legal requirements for the GPL . Now you might see this "GPL" word thrown around every now and again on web sites. If you are not familiar with the GPL/GNU, here is a good link to better understand what we are talking about......http://en.wikipedia....Gplv3#Version_3 Basically it's posting your source and changes to your work. Although most Dev's are only required to post there kernel work, more sites are encouraging that all of developers source be posted and linked, when creating a "ROM" or "kernel" thread. This is good practice, why? Well, look at CyanogenMod, for example, they post all there build environment, code, down to the littlest of things. This makes it easy for Dev's and aspiring alike to fork there work and be able to build there own stuff. This is the whole "Open Source" "sharing is caring" thing is all about and basically what Google designed Android to be...Open and free!
 
Git (and Github) offers a great way for a person, such as a reader of this post, to start a new git project based on the source code of someone else. For example, an original kernel project or CM,AOKP,PA,ROOTBOX,XEON,ECLIPSE,PACMAN, etc. In git's terms, you will "fork" the project, that you find into your own repository on github. Yes this means go to www.github.com and setup an account(this will be explained more).This creates something that belongs to you (well in a sense) Initially, you're only creating a link in your project to a very specific version of whatever or whoever you forked or cloned it from. This appears and acts like a full copy,in ways it's actually better than a normal copy. Another example would be you starting a project from the ground up with your own code. You can, of course, also create a new project from scratch and add new files directly. However, it's considered a better practice to fork from an existing project if possible. This saves a considerable amount of space on the Github server as it's really only keeping a single copy of that original source. It also makes it much easier to pull in changes from the original project (and push changes back to it.) Unfortunately, it's sometimes difficult to find a "clean" branch to fork from. This sometimes takes some time and effort to find what your looking for but i can almost assure someone, somewhere has what your looking for or close to it.
 
Before forking any project, you'll first need to create a Github account if you don't already have one. Just go to http://github.com and click "Sign up for free." You'll be presented with a page reminding you of the high cost of this service (free) and asking you for a username, email address, and password. Fill in that information and click "Create an account" (which implies acceptance of their terms of service and privacy policy.) That's it. You now have a Github account. Remember,make a good password for god sakes! You will be storing many GB's of data on github it sure would be a shame for all your hard work to get wiped out!
 
Now the next step is to find a repository that you want to fork. When you find the "repo" that contains the source you want, your ready for the next step. Finally,here comes the hard part!!! This is a highly complicated procedure so please pay very careful attention to these instructions....... On the upper right of the Github webpage, there's a button labeled "Fork." Go ahead and press it. That's it. (Yeah,some ppl really do mess that up) You now have, at least on the github site, your own copy of whatever source you are inspiring to work with, this allows you to modify it, pull it to your PC, insert new code to it, etc. This can be all done from the github GUI interface or a terminal.  Leave that browser window open while doing the next step. It contains something we'll need very shortly...
 
**NOTE***
Parts of this are taken from Github's own "Bootcamp/Set Up Git" webpage at: https://help.github.....platform-linux I'd encourage you to go to that link and review it as well!!!!!!!!!!!
 
Back on your build machine, open up a 'terminal' window and type the following command, replacing "Your Name" with your own name. Leave the quotation marks in place.
 
Code:
$ git config --global user.name "Your Name"
This is telling your local git software what your name is. This shows up in all your git commits, so you probably don't want to put something stupid here.
 
Also in the terminal window, you'll type this next command. This time, replace "your@email.com" with the email address you used to register on Github. (This is important!)
 
Code:
$ git config --global user.email your@email.com
 
Finally, there is one more command to type. This last one will tell git to cache (store) your Github account information so you don't have to type a password every single time you push to the server. (By default, it caches for 15 minutes. Read the Github bootcamp article linked above to find out how to extend that.)
Code:
$ git config --global credential.helper cache
 
 
Now, it's finally time to get the source code to your build machine. Remember I suggested leaving the browser window open on the github page showing your newly forked project? Well, what we actually want is the page URL. It should look something like "https://github.com/y...yourPulling.git" "yourUserName" should be your Github user-name. We need that URL and add ".git" to tell git what to fetch. In this case, we'll be using the "clone" command which basically just tells git to make a copy of the remote project. You won't be able to just copy/paste the following command into your terminal window, because you'll have to change at least the yourUserName part of the URL. Go ahead and type this command (making the change needed.)
 
 
****NOTE**** Whatever your pulling/cloning make sure your pulling into the right directory. Example: if your pulling XXX from a terminal window type "mkdir xxx" This will make a folder in your home directory. Then type "cd xxx". The cd command means "change directory" 
 
Code:
When the command finishes, you'll have a new sub-directory inside of whatever you made on your home directory called "xxx".
 
 
This is just to get you started using git and github. Please visit gihub's bootcamp and other tutorials to find more in-depth commands and answers to frequently asked questions. I hope this helped a few people with understanding how to get started with github and how sharing your source can benefit a greater good, by other developers using it and/or passing it along. This is how Android gets better imo, it's not owed by us so the best thing we can do is share what we have and give it away. Enjoy fellow Android enthusiasts......
 
DirtyDroidX

 


  • Memnoch73, twister250, usmcamgrimm and 2 others like this

#2 Memnoch73

Memnoch73

    ~The Devil~

  • Smod
  • 5,016 posts
  • Google+:memnoch73@gmail.com
  • LocationRochester, NY
  • Current Device(s):Pixel 3XL

Posted 26 July 2013 - 10:06 PM

great write up man... good to see ya again.  :)


  • DirtyDroidX likes this

Bluesig3_zpsfd248ca4.png

 


#3 DirtyDroidX

DirtyDroidX

    The Enigma

  • Superuser
  • 60 posts
  • LocationPittsburgh, Pennsylvania
  • Current Device(s):Note 2, Note 8.0, Nexus 7

Posted 26 July 2013 - 10:17 PM

great write up man... good to see ya again. :)



Thanks bud. I would not say I'm back just...around, you can say ;)

Sent from my SAMSUNG-SGH-I317 using Tapatalk 4 Beta


  • rickw and johnthehillbilly like this

#4 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 26 July 2013 - 11:28 PM

Awesome write up man! Lots of great information in there!


  • DirtyDroidX likes this

#5 rickw

rickw

    corvette dude

  • Administrator
  • 1,951 posts
  • Google+:rickwebb001@gmail.com
  • LocationDelaware
  • Current Device(s):S4 dev edition,moto x dev,Nexus 6

Posted 27 July 2013 - 03:38 AM

good to seeya DDX



#6 timpohladthomas

timpohladthomas

    OSE DEVELOPER

  • Developer
  • 1,428 posts
  • Twitter:@timpohladthomas
  • Current Device(s):MOTO X

Posted 27 July 2013 - 04:29 AM

Well done, I will be reading and rereading this today! THANKS!


PDbEXCr.png

Thank Zoo/Owain for my Awesome Sig! If you want to support the Build Server that helps keep OSE going, Click HERE!


#7 tucstwo

tucstwo

    www.drdevs.com

  • Administrator
  • 14,435 posts
  • Twitter:tucstwo
  • Google+:tucstwo@gmail.com
  • LocationNJ
  • Current Device(s):LG G3 VS985, Nexus 7 (flo)

Posted 30 July 2013 - 04:36 PM

Nice, this is very helpful, Dave! We needed something like this for all these new guys compiling. Perhaps now they can start creating their own stuff and working together  :wub:


  • timpohladthomas and shane1 like this

Visit DRDevs.com hosting site for all official Droidrzr.com ROMs, Apps, GApps and other mods/files!!
Please PM me if you need help!
I will be hosting AOSP-Based ROM GApps packages!
Download the most Up-to-Date GApps Packages for AOSP ROMs from me here!


#8 timpohladthomas

timpohladthomas

    OSE DEVELOPER

  • Developer
  • 1,428 posts
  • Twitter:@timpohladthomas
  • Current Device(s):MOTO X

Posted 30 July 2013 - 05:11 PM

Nice, this is very helpful, Dave! We needed something like this for all these new guys compiling. Perhaps now they can start creating their own stuff and working together :wub:


Let's do it!

PDbEXCr.png

Thank Zoo/Owain for my Awesome Sig! If you want to support the Build Server that helps keep OSE going, Click HERE!


#9 livinginkaos

livinginkaos

    I don't know what I'm doing anymore.....

  • Administrator
  • 15,282 posts
  • Google+:Hangouts - livinginkaos@gmail.com
  • LocationOregon
  • Current Device(s):Samsung S8+ / Pixel XL 128gb / iPhone 7+ 256gb / iPad Pro 12.9" / Samsung Chromrbook Plus / Pixel C / Nexus 6p 128gb / Nexus 6 / Nexus 6 on Fi / Nexus 9 / Moto 360^2 / Nvidia Shield TV Pro / Nvidia Shield Tablet / HTC EVODesign on FreedomPop / Chromecast / Surface Pro 3 i7 / Samsung Tab Pro 12.2 / Lenovo Win8 Tab / Eee Slate / '13 Nexus 7

Posted 30 July 2013 - 05:47 PM

Super job !

b2wvCBn.png

Sig by livinginkaos
Samsung S8+ / Pixel XL 128gb / iPhone 7+ 256gb / iPad Pro 12.9" / Samsung Chromrbook Plus / Pixel C / Nexus 6p 128gb / Nexus 6 / Nexus 6 on Fi / Nexus 9 / Moto 360^2 / Nvidia Shield TV Pro / Nvidia Shield Tablet / HTC EVODesign on FreedomPop / Chromecast / Surface Pro 3 i7 / Samsung Tab Pro 12.2 / Lenovo Win8 Tab / Eee Slate / '13 Nexus 7


#10 johnthehillbilly

johnthehillbilly

    Gear jammin' S-Mod

  • Smod
  • 6,470 posts
  • Twitter:@johnhillbilly
  • Google+:http://goo.gl/ColUJ .. johnthehillbilly@gmail.com
  • LocationSomewhere between here, and there...
  • Current Device(s):unlocked RAZR HD (xt926)... RAZR (xt912)

Posted 30 July 2013 - 05:56 PM

I would not say I'm back just...around, you can say ;)


Sent from my SAMSUNG-SGH-I317 using Tapatalk 4 Beta


Glad to have you just.... around LOL

Great write up bro .... ;)

... telekinetically tapped, tenaciously traversing the terrain ...


Feeding my android addiction......... one phone at a time.....

jhf.png

If you are feeling generous and would like to buy me a drink.... coffee :)


#11 tucstwo

tucstwo

    www.drdevs.com

  • Administrator
  • 14,435 posts
  • Twitter:tucstwo
  • Google+:tucstwo@gmail.com
  • LocationNJ
  • Current Device(s):LG G3 VS985, Nexus 7 (flo)

Posted 15 August 2013 - 04:22 PM

LMFAO, I never noticed the subject of this thread with the "how to && getting started", lol. Nice little drop there for the linux geeks.  :lol:


  • johnthehillbilly likes this

Visit DRDevs.com hosting site for all official Droidrzr.com ROMs, Apps, GApps and other mods/files!!
Please PM me if you need help!
I will be hosting AOSP-Based ROM GApps packages!
Download the most Up-to-Date GApps Packages for AOSP ROMs from me here!


#12 johnthehillbilly

johnthehillbilly

    Gear jammin' S-Mod

  • Smod
  • 6,470 posts
  • Twitter:@johnhillbilly
  • Google+:http://goo.gl/ColUJ .. johnthehillbilly@gmail.com
  • LocationSomewhere between here, and there...
  • Current Device(s):unlocked RAZR HD (xt926)... RAZR (xt912)

Posted 15 August 2013 - 04:27 PM

LMFAO, I never noticed the subject of this thread with the "how to && getting started", lol. Nice little drop there for the linux geeks. :lol:


Thought you would have caught that LOL ;)

" ... try not ... do! or do not! ... there is no try ..."


Feeding my android addiction......... one phone at a time.....

jhf.png

If you are feeling generous and would like to buy me a drink.... coffee :)


#13 DirtyDroidX

DirtyDroidX

    The Enigma

  • Superuser
  • 60 posts
  • LocationPittsburgh, Pennsylvania
  • Current Device(s):Note 2, Note 8.0, Nexus 7

Posted 15 August 2013 - 04:28 PM

LMFAO, I never noticed the subject of this thread with the "how to && getting started", lol. Nice little drop there for the linux geeks. :lol:


;)

Sent from my SAMSUNG-SGH-I317 using Tapatalk 4






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users