GIT commands
- GIT CONFIGURATION
- Configuring user information used across all local repositories
- Set name that is identifiable for credit when review version history
- git config --global user.name "[firstname lastname]"
- git config --global user.email "[valid-email]"
- GIT SETUP & INIT
- Configuring user information, initializing and cloning repositories
- Initialize an existing directory as a Git repository- git init
- Rtrieve an entire repository from a hosted location via URL- git clone [url]
- GIT STAGE
- Show modified files in working directory, staged for your next commit- git status
- Add a file as it looks now to your next commit (stage)- git add [file]
- Unstage a file while retaining the changes in working directory- git reset [file]
- Configuring user information, initializing and cloning repositories
- Initialize an existing directory as a Git repository
- git init
- git clone [url]
- GIT STAGE
- Show modified files in working directory, staged for your next commit- git status
- git status
- git add [file]
- git reset [file]
- Diff of what is changed but not staged
- git diff
- Diff of what is staged but not yet commited
- git diff --staged
- Commit your staged content as a new commit snapshot
- git commit -m "[descriptive message]"
- GIT BRANCH & MERGE
- List your branches
- Create a new branch at the current commit- git branch [branch-name]
- Switch to another branch and check it out into your working directory- git checkout
- Merge the specified branch's history into the current one- git merge [branch]
- Show all commits in the current branch's history- git log
- git branch [branch-name]
- git checkout
- git merge [branch]
- git log
Comments
Post a Comment