Git Commands
Visit this site for Viewing the complete Refernce:
--
A list of my commonly used Git commands
--
Getting & Creating Projects
Command | Description |
---|---|
| Initialize a local Git repository |
| Create a local copy of a remote repository |
Basic Snapshotting
Command | Description |
---|---|
| Check status |
| Add a file to the staging area |
| Add all new and changed files to the staging area |
| Commit changes |
| Remove a file (or folder) |
Branching & Merging
Command | Description |
---|---|
| List branches (the asterisk denotes the current branch) |
| List all branches (local and remote) |
| Create a new branch |
| Delete a branch |
| Delete a remote branch |
| Create a new branch and switch to it |
| Clone a remote branch and switch to it |
| Rename a local branch |
| Switch to a branch |
| Switch to the branch last checked out |
| Discard changes to a file |
| Merge a branch into the active branch |
| Merge a branch into a target branch |
| Stash changes in a dirty working directory |
| Remove all stashed entries |
Sharing & Updating Projects
Command | Description |
---|---|
| Push a branch to your remote repository |
| Push changes to remote repository (and remember the branch) |
| Push changes to remote repository (remembered branch) |
| Delete a remote branch |
| Update local repository to the newest commit |
| Pull changes from remote repository |
| Add a remote repository |
| Set a repository's origin branch to SSH |
Inspection & Comparison
Command | Description |
---|---|
| View changes |
| View changes (detailed) |
| View changes (briefly) |
| Preview changes before merging |
Last updated