Junior — Middle
What Git commands do you usually use in your work?
sobes.tech AI
Answer from AI
The following commands are commonly used when working with Git:
git clone— cloning a repository.git status— checking the current state of the repository.git add— adding changes to the index for a subsequent commit.git commit— creating a commit with a description of changes.git push— sending local commits to a remote repository.git pull— fetching and merging changes from a remote repository.git branch— viewing and managing branches.git checkout— switching between branches or commits.git merge— merging branches.git log— viewing commit history.
Example of a simple workflow:
git pull origin main
# make changes to the code
git add .
git commit -m "Added a new test"
git push origin main
These commands cover the main tasks for version control in daily work.