Maven & Git Flashcards
What is Maven?
It is a project management and build automation tool. Helps in building and documenting a project. It is based on the POM (project object model).
What is the default maven build lifecycle?
The default lifecycle handles project deployment and testing. This is the point where .JAR files are created.
Where from/ when does Maven retrieve dependencies ? Where are they stored locally?
They are retrieved from the Maven repository when the program is ran. They are stored on the hidden M2 directory that is within your home directory. (~/.m2 – This is where your dependencies are stored locally).
What is the POM and what is the pom.xml?
The POM is the project object model. The pom.xml contains all the information regarding the project and configuration details. When we tend to a task, Maven searches for the POM in the current directory. Also includes the plugins used by Maven in the project.
It makes sure that a project has the right JAR files.
Maven updates the dependences according to the POM.
What defines Maven project coordinates?
A group identifier, an artifact identifier, and the version.
What is version control?
Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.
What is the difference between git and GitHub?
GitHub is the website that hosts repositories and git is the version control system.
List the git commands you know and what they do
git clone (allows you to clone a git repository from github onto your local device), git add (adds your branch to the staging area), git commit -m”” (commits the staging environment to the repository), git push (adds your branch to the GitHub website). Git checkout allows you to move between different branches. Git checkout -b allows you to create a new branch.
How would you prevent a file from being tracked by git?
You would put that file ino the .gitignore file.
What is a branch? What are some common branching strategies?
A branch is a different version of a repository created by a contributor. The main branching strategy is to have the default branch reflect the program’s production state and a second branch to represent development. All other branches are generally small changes made to the development state which may eventually merge with the production state.
What is a merge conflict? How do you prevent it? How do you resolve it?
Conflicts generally arise when two people have changed the same lines in a file, or if one developer deleted a file while another developer was modifying. You prevent it with communication. You resolve it by editing the conflicted file.
What is a GitHub pull request?
A pull request is letting other developers know about the changes you’re about to merge of the branch you’re in and it allows you to review that code or merge conflicts if necessary.
What is the git workflow for editing code and saving changes?
Clone the repository or pull if you can, go into the repository, make changes, add it, commit it, push it.
What is a commit?
A commit is a snapshot of your repository at a certain time. The commit process occurs right before the ‘push’ process, when the repository officially gets added to the cloud.
How would you go back in your commit history if you make a mistake?
You would get the commit ID of the previous version of the repository by using $ git checkout and then “pushing” that previous version to the cloud.