Github

    Mesa Robotics Organization very own Github code repository


    Email robomro@gmail.com with your Github account name if you want push authorization, otherwise feel free to clone the repo onto your computer.

    What is Git and Github exactly? (motivation for MRO members to start using it!)

    Git is a program that basically tracks every revision made in files (source codes in programming). It efficiently stores the changes and allows multiple people to work on the same code without having them to pass back and forth the edited code between each other constantly through email or USB.

    One of the many great things about Git is that the entire history of the source code is recorded, so you can always go back to the earlier history and learn everything about the program, like where a bug was in the code, how it was fixed, what was changed in the code. You can even restore the file back to its previous state if you want.

    Github is a git server that provides free hosting of git repositories. It's safe and secure and allows good amount of storage. You don't even need to have an account to start downloading our repository.

    The most important thing about Git though is that every code in MRO will be saved so future members won't have to start from scratch again.

    Tutorial for Git:

    Windows:

    2. Create an account.
    3. Email robomro@gmail.com with your account name
    5. Download msysGit (easier than Cygwin)
    6. Install msysGit (you should get an icon like this on your desktop 
    7. Double click it, then a command line should pop up.
    8. Setup your SSH key by typing in this in the command line:
    ssh-keygen.exe
    9. Leave the default file to save the key to be .ssh/id_rsa (just press <Enter>, it will go to the next prompt)
    10. Enter your password for the key, now you have created a public key for your user
    11. Now using cd (change directory) in the command line, go to the folder where you want to store our repository
    12. Then in the command line, enter this exactly:
    git clone https://github.com/MesaRoboticsOrganization/Mesa-Robotics-Organization.git
    13. It will create a local git repository in the folder that you are in
    14. Now you are done, the folder will be called Mesa-Robotics-Organization
    15. If you sent your account name to robomro@gmail.com, then you will be able to push (add / modify stuff to our software repository). 

    How to push:
    16. Enter these lines into msysGit:
    git config --global user.name "<Your name here>"
    git config --global user.email "<Your email here>"
    17. Git needs these because everytime you modify the repository, everyone will know that it is you.

    You will only have to do #16 once, after setting up the initial stuff you won't have to do git config anymore.

    18. Now go to your location of your public key folder, 99.99% of the time it should be in
    C:/Users/<your name>/.ssh/
    19. There should be two files name id_ra, open the one that has the ending in pub, so open id_rsa.pub with Notepad (right-click on the file and click Open With..., then expand "Other Programs" and you should see Notepad). EX:

    20. Copy everything in the file exactly and go to your Account Settings in your Github account.

    21. Now go to your SSH Public Keys:

    22. And paste everything (from the id_rsa.pub file) into your new key:



    23. After you created / edited the files in your local repository, make sure you are in the top level of Mesa-Robotics-Organization (your local repository) and enter this in msysGit:
    git add . <--THAT IS A DOT, remember to type it in or else the command won't work
    24. Now do this:
    git commit -m "<Type your notes in here>"
    25. Finally do this:
    git push
    26. Now the repository will be updated with your new stuff it in and your name will be attached to the commit.

    Note: You will only have to do steps #16-22 only one time, after the initial setup everything is pretty easy. So in summary, whenever you want to push stuff into our repository, just go to the top level of your repository (a.k.a Mesa-Robotics-Organization folder) and do this:

    git add .
    git commit -m "<Your Notes>"
    git push

    That's it, pretty easy isn't it?

    How to update your local repository:

    If you see that there are new stuff in our repository on Github, you can update your local copy pretty easily.

    1. Open up msysGit
    2. Go to your Mesa-Robotics-Organization (using cd)
    3. Type in this:
    git pull
    4. Now your local copy of our repository is updated with the new stuff on our Github repo.

    Linux/*nix (should be mostly the same for Macintosh...?):
    1. Since you are using Linux/*nix, I assume that you are familiar with the terminal environment.
    2. Check if you have git, go to your terminal and type git, if it says something like file not found, then you don't have git, just install it with the package manager for your system if you don't have git.
    3. Then just follow the same steps for Windows except just type the command in your terminal, you don't need msysGit.


    If you are stuck on some step just email me (Kiet <ktklam9@gmail.com>) or just go to our Google Group and ask.