Sobes.tech
Junior

What commands do you use in Git?

sobes.tech AI

Answer from AI

  • git clone <url>: Clones a remote repository.
  • git add <file>: Adds changes to the staged index.
  • git commit -m "commit message": Creates a commit with the changes in the index.
  • git status: Shows the status of the working directory and index.
  • git push: Pushes local commits to the remote repository.
  • git pull: Downloads changes from the remote repository and merges them.
  • git branch: List of local branches.
  • git checkout <branch>: Switches to another branch.
  • git merge <branch>: Merges the specified branch into the current one.
  • git log: Shows the commit history.
  • git diff: Shows the difference between changes.
  • git remote -v: List of remote repositories.
  • git reset <mode> <commit>: Reverts changes. Modes: --soft, --mixed, --hard.
  • git stash: Temporarily saves uncommitted changes.
  • git rebase <branch>: Rebase the current branch onto the specified one.