programmingbeginner
Git Version Control Essentials
Master essential Git commands for version control and collaboration
6 cardsFlashcardMaker0 clones
Clone this Deck & Start StudyingFlashcards (6)
Card 1
What does "git init" do?
Initializes a new Git repository in the current directory, creating a .git folder to track version history.
Card 2
What is the difference between "git pull" and "git fetch"?
git fetch downloads changes from remote but doesn't merge them. git pull downloads changes AND merges them into your current branch.
Card 3
What does "git stash" do?
Temporarily saves uncommitted changes, allowing you to switch branches without committing. Use "git stash pop" to restore changes.
Card 4
What is the difference between "git merge" and "git rebase"?
git merge creates a new commit that combines branches. git rebase moves/replays commits onto another base, creating a linear history.
Card 5
How do you undo the last commit but keep the changes?
Use "git reset --soft HEAD~1" to undo the commit but keep changes staged, or "git reset HEAD~1" to unstage them.
Card 6
What does "git cherry-pick" do?