Test bed for git operations.
Run the following commands with your favorite shell program. (cmd, powershell, bash, git bash, etc.)
- Create a new repository on github.com.
- Checkmark "Initialize this repository with a README".
- Click "Create repository" button.
git clone <repository URL>
Your local repo is now ready for your changes.
- Create new branch for work.
git branch <new branch name>
- Confirm current branch.
git branch
- Switch to new branch.
git checkout <new branch name>
- Add files to the new branch. Set to "." for resursive add.
git add <filename>
- Confirm which files have been added.
git status
- Commit changes.
git commit -m <commit message>
- Push new branch along with changes upstream.
git push --set-upstream origin <new branch name>
git pull
git diff
- Switch to a new branch, and set it up to track the remote branch from origin.
git checkout --track origin/<new branch name>
- Add files to commit.
git add <file1> <file2> ...
- Commit changes.
git commit -m <commit message>
- Push upstream.
git push