Git & GitHub Flashcards
What’s a version control system? And how do we classify Git?
A VSC is a way of handling with multiple versions of a document, creating a way of ‘time traveling’ through these versions.
GIT is a distributed version control system.
What’s the difference between Git and GitHub?
Github is just a place where we can store our git repositories.
How do you configure your git to add your name and email?
git config –system user.name “name of person”
git config –system email@email.com
How to initialize a git repo?
on the directory you want to version control:
git init
What are the 3 stages a file can be?
1 - untracked
2 - on stage (goes on the next commit)
3 - commited (ready to push)
How do you change branches?
git checkout branch_name
or to create and go:
git checkout -b newBranchName
How do you list you current branches?
git branch
How to delete a branch?
git branch -D
How to see how is the status of your repository?
git status
How to add a file to the “on stage” state?
git add file
How to commit a change to the staged files?
git commit -m “msg of commit”
How to upload your changes to your github repo?
git push -u origin master
This pushed your master branch to the remote repo
-u flag sets the upstream so we can use just ‘git push’ after that
How to add the URL of the remote repo?
git remote add origin “http/ssh url”
“origin” here is the nickname of our repo
How to check the current URL of our remote repo?
git remote -v
How to clone a repo?
git clone repo_url
Will create a directory on the pwd that will hold the project cloned