Branches Flashcards
What is a “branch”?
Branches to create development “branches”. Ideal for creating features separately and then adding them to the main branch.
What is the new default branch name when you create a project through GitHub?
main
What is the command to create a new branch?
git branch <branch_name>
What is the command to switch branches?
git checkout <branch>
What is the difference between the git branch and git checkout commands?
git branch is used to create new branches, git checkout is used to change branches
How do we delete a branch?
git branch -d <branch>
What does this command: git checkout -b <branch>?
Exit of the actual branch, creates a new and goes to the new branch
Usually, will we use the command git merge from which branch?
main
Complete the following command:
git merge …
<branch>
What is the command to list all branches?
git branch
Complete:
Files created in a branch […]
are associated with this branch
Alias for
git push –set-upstream origin <branch_name>
git push -u origin <branch_name>
If we don’t have a branch in Github, how can we push our local changes only for this branch in Github?
We type the command git push –set-upstream origin <branch_name>
Where does the branches live?
In the Local and Remote repository
Not in Working directory or staging area
Pointer that points to the current branch and commit you are currently at.
HEAD