Remove All Ads from XDA
Thread Deleted Email Thread
Prev Previous Post   Next Post Next
Today I would like to show you how to use github. I'm not an expert (I'm rather n00b TBH ) but I learned some things and might help you with simple git commands.

1. Github? What's that?

In short it's the web-based hosting service for software development projects that use the Git revision control system. In English - the place where you store your sources.

2. Creating an account.
  • 2.0 Download the required libs
    sudo apt-get install git
  • 2.1 Create an account on website
  • 2.2 In terminal type:
    git config --global "Your Name Here"
    git config --global "[email protected]"
    NOTE: use the e-mail used in the website account creation
    2.3 Create your unique SSH public key
    ssh-keygen -t rsa -C "[email protected]"
    # Creates a new ssh key using the provided email
    # Generating public/private rsa key pair.
    # Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter]
    Now you need to enter a passphrase.
    # Enter passphrase (empty for no passphrase): [Type a passphrase]
    # Enter same passphrase again: [Type passphrase again]
    Which should give you something like this:
    # Your identification has been saved in /c/Users/you/.ssh/id_rsa.
    # Your public key has been saved in /c/Users/you/.ssh/
    # The key fingerprint is:
    # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]
    Now go to ~/.ssh folder and copy your content into account administration on

    ... and check if everything works

    ssh -T [email protected]
    The authenticity of host ' (' can't be established.
    # RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
    # Are you sure you want to continue connecting (yes/no)?
    Duh?! Sure I want! Yes! Yes! Yessss!

    # Hi username! You've successfully authenticated, but GitHub does not
    # provide shell access.

And we are ready to do some serious things!

3. Forking a repo

As an example I'll use
Open this link in the browser and click fork.

  • 3.1 Clone the source from your fork.
    I use my account as an example.

    git clone git:// -b gingerbread
    -b gingerbread let us to choose what branch are we going to download

  • 3.2 Do some changes!

    For example add files, remove them etc.
  • 3.3 Commit the changes

    OPTIONAL I created new branch at my project and named it "xda"
    To do this go to the cloned folder and type:
    git branch xda
    git checkout xda
    Now it's time to see what's going on:
    Magic command
    git status

    As you can see I removed few files and added one.

    Now it's time to tell the git what we want to do.

    4. Pushing the changes

    Add all modified files:
    git add .
    Add all removed files
    git add -u
    You can also add/rm one file
    git add name_of_file
    git rm name_of_file
    After git status we should get something like this:

    Now it's time to commit:

    git commit -m 'my first commit'
    And finally to push:

    git push
    If you'll get some errors use the following:

    git push [email protected]:eagleeyetom/android_packages_apps_Settings.git xda
    I used the name of my github and the name of the branch in the end.

    Woo hoo! Now let's check the website.

That's the most basic basics
In the next posts I will show you some more advanced commands like merge, cherry-pick, removing branches etc.

Github Team
All my friends from GingerDX IRC channel

If you find it useful hit thanks button. You can also consider a small donation
The Following 362 Users Say Thank You to eagleeyetom For This Useful Post: [ View ] Gift eagleeyetom Ad-Free
Subscribe to Thread

git, github, guide, pull request

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes