Shared Flashcard Set

Details

Git Commands
A list of Git commands
57
Computer Science
Not Applicable
07/31/2019

Additional Computer Science Flashcards

 


 

Cards

Term
What kind of program is Git?
Definition
It is a version control program
Term
What are the differences between Git and a text editor in terms of what they save and their record keeping?
Definition
A text editor can only make and save changes to a file.
Term
Does Git work at a local or remote level?
Definition
Git works on a local level. Any changes you make are saved locally with Git.
Term
Does GitHub work at a local or remote level?
Definition
GitHub works on a remote level. You must push your local changes (using Git) to Github.
Term
Why is Git useful for an individual developer?
Definition
Git is useful for creating snapshots of your work. If you realize halfway through that you've messed up, it's much easier to reset.
Term
Why is Git/GitHub useful for a team of developers?
Definition
Git and GitHub are useful for teams because they can merge code together. A developer can work on one part of the code while a second developer works on another part. They can then use Git/GitHub to easily combine their changes.
Term
What is the Git help command
Definition
git help
Term
What is the Git Configure command?
Definition
git config
Term
What is the command for Active Bash Changes?
Definition
source <file>
Term
What is the command for making intermediate directories?
Definition
mkdir -p
Term
What is the command for showing the status of a repository
Definition
git status
Term
What is the command for creating an empty file?
Definition
touch <name>
Term
What is the command for adding all files or directories to a staging area?
Definition
git add -A
Term
What is the command for adding a given name or directory to a staging area?
Definition
git add <name>
Term
What is the command for a commit staged changes with a message?
Definition
git commit -m
Term
What is the command for a stage and commit changes with a message?
Definition
git commit -am
Term
What is the command for showing the diff between commits, branches, etc.?
Definition
git diff
Term
What is the command for git commit amending the last commit?
Definition
git commit --amend
Term
What is the command for showing the diff vs. SHA?
Definition
git show <SHA>
Term
What is the basic Git syntax
Definition
program | action | destination.
Term
What is the command for setting a name that is identifiable for credit when review version history?
Definition
git config --global user.name "[firstname lastname]"
Term
What is the command for setting an set an email address that will be associated with each history marker?
Definition
git config --global user.email "[valid-email]"
Term
Wht is the command for setting automatic command line coloring for Git for easy reviewing?
Definition
git config --global color.ui auto
Term
What is the command for initializing an existing directory as a Git repository?
Definition
git init [project-name]
Term
?
Definition
git clone [url]
Term
What is the command for showing modified files in working directory, staged for your next commit ?
Definition
git status
Term
What is the command for adding a file as it looks now to your next commit (stage)?
Definition
git add [file]
Term
STAGE & SNAPSHOT part 3 What is the command for unstage a file while retaining the changes in working directory?
Definition
git reset [file]
Term
STAGE & SNAPSHOT part 4 What is the command for diff of what is changed but not staged?
Definition
git diff
Term
STAGE & SNAPSHOT part 5 What is the command for diff of what is staged but not yet committed?
Definition
git diff --staged
Term
STAGE & SNAPSHOT part 6 What is the command for committing your staged content as a new commit snapshot ?
Definition
git commit -m "[descriptive message]"
Term
What is the command for listing your branches. a * will appear next to the currently active branch ?
Definition
git branch
Term
What is the command for create a new branch at the current commit?
Definition
git branch [branch-name]
Term
What is the command for switch to another branch and check it out into your working directory?
Definition
git checkout
Term
What is the command for merge the specified branch's history into the current one?
Definition
git merge [branch]
Term
What is the command for show all commits in the current branch's history?
Definition
git log
Term
What is the command for showing the commit history for the currently active branch?
Definition
git log
Term
What is the command for showing the commits on branchA that are not on branchB
Definition
git log branchB..branchA
Term
What is the command for showing the commits that changed file, even across renames?
Definition
git log --follow [file]
Term
What is the command for showing the diff of what is in branchA that is not in branchB?
Definition
git diff branchB...branchA
Term
What is the command for showing any object in Git in human-readable format?
Definition
git show [SHA]
Term
Tracking path changes part 1 What is the command for deleting the file from project and stage the removal for commit?
Definition
git rm [file]
Term
Tracking path changes part 2 What is the command for changing an existing file path and stage the move?
Definition
git mv [existing-path] [new-path]
Term
Tracking path changes part 3 What is the command for showing all commit logs with indication of any paths that moved?
Definition
git log --stat -M
Term
SHARE & UPDATE? part 1 What is the command for adding a git URL as an alias?
Definition
git remote add [alias] [url]
Term
SHARE & UPDATE? part 2 What is the command for fetching down all the branches from that Git remote?
Definition
git fetch [alias]
Term
SHARE & UPDATE? part 3 What is the command for merge a remote branch into your current branch to bring it up to date?
Definition
git merge [alias]/[branch]
Term
SHARE & UPDATE? part 4 What is the command for Transmit local branch commits to the remote repository branch?
Definition
git push [alias] [branch]
Term
SHARE & UPDATE? part 5 What is the command for fetch and merge any commits from the tracking remote branch?
Definition
git pull
Term
What is the command for apply any commits of current branch ahead of specified one?
Definition
git rebase [branch]
Term
What is the command for clear staging area, rewrite working tree from specified commit?
Definition
git reset --hard [commit]
Term
What is the command for saving modified and staged changes ?
Definition
git stash
Term
What is the command for listing stack-order of stashed file changes ?
Definition
git stash list
Term
What is the command for writing working from top of stash stack?
Definition
git stash pop
Term
What is the command for discard the changes from top of stash stack?
Definition
git stash drop
Term
What is the command for Saving a file with desired patterns as .gitignore with either direct string matches or wildcard globs.
Definition
logs/
Term
What is the command for system wide ignore pattern for all local repositories
Definition
git config --global core.excludesfile [file]
Supporting users have an ad free experience!