# ============= github.com cheat sheed apt-get update; apt-get install git; # install git # global config git config --global user.name "[name]"; # sets the username to label your commits git config --global user.email "[email address]"; # sets the email to label your commits # if you are working with eclipse you probably want to ignore all the per-project generated config files vim ~/.gitignore_global # fill it with this content .classpath .project .settings .idea .metadata # cloning the repo to local mkdir /projects/projectname; # create a new folder for your project cd /projects/projectname; # change into that dir git clone https://github.com/username/reponame.git . ;# clone the repo into the current directory git pull; # get latest sources from server git branch; # on what branch am i? git show-branch -a; # show all branches git branch [branch-name]; # create a new branch git checkout [branch-name]; # Switches to the specified branch and updates the working directory git merge [branch]; # Combines the specified branch’s history into the current branch git branch -d [branch-name]; # Deletes the specified branch git commit -a -m 'i made this and that thanges'; # commit your changes git remote -v; # show urls associated with your project git push https://github.com/username/NameOfRepo.git "branch_name"; # comit a branch to githup.com # ===== if you do not want to be asked for your credentials ever time you commit something you can store your username and password in plaintext here: vim ~/.netrc machine github.com login password # ============= links # https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository