GIT Chapter 1 Flashcards
What is a ‘Local Repository’ ?
Files which are stored on your laptop in Git is called Local Repository.Modifications done here in files - Git will maintain history of changes
what is the purpose of the command ‘CLONE’ ?
Used to checkout code from remote repository
what is a ‘Remote Repository’ ?
The repository on server is called ‘Remote Repository’
How do we copy or checkout code from server ?
We can ‘checkout’ code from server ( remote reposiotry ) using the CLONE command.
What are ‘HEADS’ ?
This is just a term - by which Git maintains commit history for each branch.
How do we see different ‘BRANCHES’ ?
Use the command:
‘git branch’
what are ‘TAGS’ ?
This is a useful feature - which allows us to create a SNAPSHOT of code ‘at that point in time’.
This feature is typically used to maintain production released code - so that if ever we cant to go back to a specific version - using this feature we can.
How do I see the different tags in my code ?
Use the command:
tag -l
How do I create a new branch from an existing tag ?
Typically on first cloning from remote repository we will be in ‘master’.
Now to create a branch - xyz from a specific tag - tag123 - use the command:
git checkout -b xyz tag123
This will create a new branch - xyz
Unlike svn - you will not see any folder for new branch.
How does a ‘BRANCH’ in Git differ from SVN ?
There is no folder for a branch.
Only thing is in gitbash - it would show which branch you are working on
when you list all the branches - the branch that you are currently in - will be shown with an *
what is the advantage and use of GIT ?
It is distributed ( DVCS ) - so everyone has the completes repository on their desktop.
Commits can be made locally - ‘offline’
How do I create a ‘Repo’
Use the command :
git init
This will create a local repo.
This is the starting point
what do we mean by ‘UNTRACKED’ ?
Files that are not under GIT control are ‘Untracked’
what does the command ‘git status’ do ?
It is used to tell us what has changed since last commit.
How do I find changes since my last commit ?
Use the command :
git status