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***
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