Junior
What do you know about the Git tool?
sobes.tech AI
Answer from AI
Git is a distributed version control system.
Main concepts:
- Repository: A storage for the project with a history of changes.
- Commit: A snapshot of the project's files at a specific point in time.
- Branch: An independent line of development, allowing work on new features or fixes without affecting the main branch.
- Merge: Combining changes from one branch into another.
- Pull Request (PR): A request to merge changes from one branch into another, often with discussion and code review.
- Remote repository: A version of the repository stored on a remote server (e.g., GitLab, GitHub, Bitbucket).
Main commands:
git init: Initialize a new repository.git clone <url>: Clone a remote repository.git add <file(s)>: Add changes to the staging area.git commit -m "commit message": Create a commit.git status: View the status of the working directory and staging area.git log: View commit history.git branch <branch name>: Create a new branch.git checkout <branch name>: Switch to another branch.git merge <branch name>: Merge the specified branch into the current one.git pull: Fetch the latest changes from the remote repository and merge them.git push: Push local commits to the remote repository.git remote add origin <url>: Add a remote repository namedorigin.git fetch: Download changes from the remote repository without automatic merging.
Familiar with workflows like GitHub Flow or similar (creating feature branches, PRs, code review, merging into the main branch). Able to resolve merge conflicts.
Use Git daily for team collaboration on projects.