Git Commands Flashcards
Use to put files on stage
git add
Gives a status of last files were updated
git status
Use will open an editor to comment stats and details from your commit
git commit
Use to take a look at your history
git log
Takes a look in all branches created
git branch
Creates a new branch to work
git branch
Discards all updates at Working Directory and Staging Area - BE CAREFUL
git reset —hard
Commits files at stage
git commit
Cleans the file from stage to send to Repository
git reset
Adds files to a stage before send to commit
git add
Creates a git repository at directory with all files, when creates doesn’t create no snapshot
git init
Returns the COMMIT ID to life -Temporarily reset all files in a directory to their state at the time of a specific commit
git checkout
COMPARES FILES between Staging Area to Repository
git diff —staged
No Args - COMPARES FILES between Working Directory to Staging Area
git diff
To get differences between two commits, first the older
git diff
Copies entire structure and all versions to local directory
git clone
Switches to named branch
git checkout
Uses to see graphically in one line all branches
git log –graph –oneline
Merge two branches in a new one
git merge
Compares Commit updates to its parent
git show
Deletes a specific branch
git branch -d
Manage set of tracked repositories
git remote
Add new repository at GitHub
git remote add
V = Verbose more information about remote
git remote -v
Updates remote refs using local refs, while sending objects necessary to complete the given rfs
git push
Fetch from and integrate with another repository or a local branch
git pull
Sequence to update a file with other branch and commit to remote repository
git branch “different-oil” /create new branch
git checkout “different-oil” /access new branch
–UPDATE FILES YOU NEED
git add cake-recipe.txt
git commit
git push origin different-oil
Download objects and refs from another repository
git fetch