What is the most basic Git workflow that you can use every day?
Experience Level: Junior
Tags: GitSource control
Answer
Every day, you usually use the following git commands:
git pull
(orgit fetch
andgit merge
) - get changes of other team members from the remote repository and merge them into your current branch- ...do some changes...
git status
- see what are the changes in your workspacegit add .
- add all changes to index (staging area)git commit -m "Description of your changes"
- commit changes from index (staging area) to your local repositorygit push
- send all changes from your local repository to the remote repository
Related Git job interview questions
What is a hash in Git?
GitSource control JuniorHow do you discard all changes from your local Git workspace?
GitSource control JuniorWhat is a workspace in Git?
GitSource control JuniorHow do you add changed files from your Git workspace to Staging Area (Index)?
GitSource control JuniorWhat is .git folder?
GitSource control Junior