Skip to content
poudels14 edited this page Oct 1, 2014 · 1 revision
  1. Git

    Git a version control system similar to SVN. It is open source software developed by Linus Benedict Torvalds. It is simple and convenient to use. It has been best too of programmers as it allows us to go back to the functioning code if we mess things up last minute. It will also track who made changes and when. It is a great tool for working in huge group.

    Once you install git on your computer, you can look at the following commands. If git is not set up in your computer, you can Google it or reach out to one of our members.

    Basic Git Commands:

    1. git clone: git clone https://github.com/UPenn-RoboCup/UPennalizers.git

    This copies files in the above repo to your computer. You can only clone repository that you have access to.

    1. git add:

      git add file1.lua file2.sh file.mat

    Add untracked files to tracking list Once new files are added, git starts keeping its account

    `git add .`
    

    It adds new files also removes files from server that you locally. Be careful!

    1. git commit:

      git commit file1 file2 file3 -m “Message”

    It commits changes that you made in files1,2,4 (if they are being tracked)

     `git commit -a -m “Message”`
    

    It commits changes of all the files that are tracked

    1. git pull: git pull

    Pull all the recent changes from github/ other git server

    1. git push: git push

    Push your changes to cloud

    1. git status: git status

    Shows files that you committed but not pushed yet Shows files that you changed but not committed

    1. git checkout: git checkout <another branch name>

    Change current branch to another branch

    1. git diff

      git diff

    Difference in local files and server files(of current branch)

     `git diff branch1 branch2`
    

    Difference in codes of branch1 and branch2

    1. git stash git stash

    Remove all the changes you made but not committed. Useful when you think the changes you made are not committable.

    Advance

    1. git branch -la git branch -la

    List all branches available.

    1. git branch -d git branch -d

    This deletes fully merged branch.

    1. git branch -D git branch -D

    List deletes branch even if it's not merged.

  2. Github

    Github is a free server with unlimited storage to stores our code. Github is the official server used by most git users. You can store both public and private repository in github. Public repo is free and unlimited while private costs you money. You can also get 5 private repo with .edu email. You can set local git server for free if you don't want whole world to see your source code.

Clone this wiki locally