Module 3 Flashcards
Remote Repositories
How to clone a repository from Github’s site?
git clone <URL>
How to commit all files change in the working tree in one step?
git commit -a -m "insert commit message"
git config --global credential.helper cache
allows us to configure the credential helper, which is used for …what?
Allowing automated login to GitHub.
I provide credentials once and then will not have to do it again for a limited time period.
Name the command that gathers all the snapshots we’ve taken and sends them to the remote repository.
git push
What does git remote -v
do?
Shows the URLs for fetch and pull associated with remote origin.
How can I check if my local repo is out of sync with a remote repo?
git remote show origin
Out of date = commits made that aren’t incl. in my local repo
What’s the main difference between git fetch
and git pull
?
git fetch
fetches remote updates but doesn’t merge; git pull
fetches remote updates and merges.
What is does git remote show origin
do?
It shows additional information on the remote repository. By default, git call the remote repo as origin.
If we want to make a change to a remote branch, what must we do?
Pull the remote branch, merge it with the local branch, then push it back to its origin.
Interpret the output from the command git remote show origin shown
below
“Local out of date” tells me that my local repo is out of sync with the remote repo, meaning someone pushed changes (commits) after I pulled info from the remote repo.
Is the following statement true or false?
Git keeps remote (origin) and local branches in sync at all times
False. I can check sync status through git remote show origin
and sync by doing git pull
or git push
What does git fetch
do? What is the purpose of using it?
Fetch commits from remote repo and copy them to my remote branch.
As it download to the remote branches instead of my local branches, it won’t disrupt my work.
I can use git checkout
to switch my working tree from local to remote branch.
Interpret the screenshot below
Both git log origin/master
and git status
show me that my local master branch is out of sync to origin/master, namely, it is 1 commit behind it
I will need to do git merge origin/master
from my local master branch.
Interpret the screenshot below
Local master and remote origin/master branches are in sync.
What should you do with the conflict markers shown below when resolving a merge conflict?
Remove all of the conflict markers and only leave the code as it should be after the merge.