A quick GitHub Demo to show the students at SMU
see Wikipedia
GitHub is a web-based Git or version control repository and Internet hosting service. It is mostly used for code. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project.
- Clone an existing repository.
$ git clone ssh-key - Create a new local repository.
$ git init
- Check the changes in your working directory.
$ git status - Check changes to tracked files.
$ git diff - Add all changes to the next commit.
$ git add . - Commit previously staged changes.
$ git add -yu $ git add -u
- Add all untracked files into the stage workspace.
$ git commit -m "reminder text"
- Push local changes to remote(Github).
$ git push [remote] [branch] - Downloads all remote changes without merging.
$ git fetch - Merge branch into current branch $ git merge [branch]
- Does a git fetch followed by a git pull.
$ git pull remote branch
- List all existing branches.
$ git branch - Make new branch
$ git branch [branch name] - Switch to different branch
$ git checkout [branch] - Delete a local branch
$ git branch -d [branch]
- Stash all uncommitted changes and revert back to previous commit.
$ git stash - Apply all stashed changes to current branch.
$ git stash apply - Discard all local changes in your working directory.
$ git checkout [HEAD ID]
STEPS
- Go to repository settings
- Click on Collaborators on the left hand side
- Add collaborator via username, full name,or email
STEPS
- Go to repository
- Click on Pull request
- Click on New pull request button
- Change compare barnch to the barnch you want pulled
- Click on Create pull request
- Describe your pull request to repository admin
- Submit pull request
Git Cheat Sheet
HEAD, master, origin
git push vs git push origin master