Git
Basic Workflow
Git clone the repo you are interested in:
Now move into the directory that the reposity or now located in and initialize the repo
For any site that is going to be hosted on GitHub pages, ensure you check out the
gh-pages
branch
Now make all the chages you want to make on the repo.
To see the status of the files changed before pushing the new commits.
If these are the changes you want to make:
Now commit the changes locally
You only have to do the below command once, but this will instruct git where to push the changes to:
Now make the commit official and push to your branch:
Observing a Repository
List new or modified files not yet commited
Show the changes to files not yet staged
Show the changes to staged files
Show all staged and unstaged file changes
Show the changes between two commit ids
List the change dates and authoris for a file
Show the file changes for a commit id and/or file
Show full change history
Show change history for file/directory including diffs
Working with Branches
List all local branches
List all branches local and remote
Switch to a branch, my_branch, and update working directory
Create a new branch called my_branch
Delete the branch called my_branch
Merge branch_a into branch_b
Tage the current commit
Make a Change
Stages the file, ready for commit
Stage all changed files, ready for commit
Commit all staged files to versioned history
Commit all your tracked files to versioned history
Unstages file, keeping the file changes
Revert everything to the last commit
Synchronize
Get the latest changes from origin (no merge)
Fetch the latest changes from origin and merge
Fetch the latest changes from origin and rebase
Push local changes to the origin
Last updated