Last edited · 1 revision  


Github Cheatsheet(Under Linux)
Uses git locally, uses Github remotely

Do one-time when git is installed for the first time
$ git config --global "Your Name Comes Here"
$ git config --global

Create a new local and remote repository
Execute from the directory containing your source files one time only

$ git init                                                                                                             creates a subdirectory and builds repository in it
$ git add .                                                                                                          add all files to repository
$ git status                                                                                                        verify staged files
$ git commit                                                                                                      commit staged files
$ git remote add origin    create remote repository
$ git push -u origin master                                                                               upload to remote repository

Update an existing repository
Execute from directory containing your source files

$ git add file1 file2 file3 ...                                                                               add new or modified files

$ git status                                                                                                     verify files were added

$ git commit                                                                                                   commit to local repository

$ git push origin master                                                                                push to remote repository

Additional Commands

$ git ls-files                                                                                                   list all files in the repository

$ git rm filename                                                                                          remove a file from the repository