Introduction to Git Module #41 Flashcards
How do we add files into the staging area of GIT?
git add filename.xxx
When adding multiple files, there is no need for any kind of delineation just list the files.
How would you remove a file from staging?
git reset filename.xxx
What does this command do git commit git commit -a -m
This commits all changes and cleans up the staging area. Note, this is using two flags which is a correction to Flavio’s content.
The -a flag commits all of the updated files the -m flag is to create a message/comment which is necessary for the commit.
How can you get info on the status of GIT?
git status
Provides that status of tracked and un-tracked files
What if you want to get information about all of the committs made, by whom and what branches were affected?
git log
How are new branches created?
git checkout -b name
you can name the branch whatever you want but it has to have a name in the example above name is the name.
What is the command to see all branches?
git branch
What does push do? What’s the command?
Sends changes to the server.
git push origin master
What does pull do? What’s the command?
Pulls changes from the server made by others.
git pull origin master
What’s the command for cloning a remote repo on Github?
git remote add origin https://github.com/YOU/REPONAME.git