- Git clone the repo you are interested in:
git clone https://github.com/jtaubs1/OSCP-Prep.git
- 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
git commit -m "initial commit"
- You only have to do the below command once, but this will instruct git where to push the changes to:
git remote add origin https://github.com/jtaubs1/jtaubs1.github.io.git
- Now make the commit official and push to your branch:
- 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
git diff <commit1> <commit2>
- List the change dates and authoris for a file
- Show the file changes for a commit id and/or file
- Show change history for file/directory including diffs
git log -p [file/directory]
- 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
git checkout branch_b
git merge branch_a
- Stages the file, ready for commit
- Stage all changed files, ready for commit
- Commit all staged files to versioned history
git commit -m "commit message"
- Commit all your tracked files to versioned history
git commit -am "commit message"
- Unstages file, keeping the file changes
- Revert everything to the last commit
- 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