0
0
Gitdevops~5 mins

git push to upload commits - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the git push command do?
It uploads your local commits to a remote repository, making your changes available to others.
Click to reveal answer
beginner
Which command uploads your local branch changes to the remote repository?
git push origin branch-name uploads the specified branch to the remote named origin.
Click to reveal answer
intermediate
What happens if you try to git push but your local branch is behind the remote branch?
Git will reject the push and ask you to pull first to avoid overwriting others' changes.
Click to reveal answer
intermediate
How do you push all your local branches to the remote repository?
Use git push --all to upload all local branches to the remote.
Click to reveal answer
beginner
What is the default remote name used by git push if none is specified?
The default remote name is origin, which usually points to the main remote repository.
Click to reveal answer
What does git push do?
ADownloads changes from a remote repository
BUploads local commits to a remote repository
CCreates a new branch locally
DDeletes a remote branch
Which command uploads the current branch to the remote named origin?
Agit pull origin
Bgit fetch origin
Cgit push origin
Dgit clone origin
If your local branch is behind the remote, what should you do before pushing?
ACreate a new branch
BForce push immediately
CDelete the remote branch
DPull the latest changes first
How do you push all local branches to the remote?
Agit push --all
Bgit push --branches
Cgit push origin main
Dgit push --force
What is the default remote name used by git push?
Aorigin
Bremote
Cmain
Dupstream
Explain in simple terms what happens when you run git push.
Think about sharing your work with friends.
You got /3 concepts.
    Describe what you should do if git push is rejected because your local branch is behind the remote.
    Imagine updating your copy before sharing your changes.
    You got /3 concepts.