You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(You can use different usernames and email addresses, but this affects commit history.)
git config --global init.defaultBranch main
Change the default branch from master to main.
git help config
Launch browser Git help page.
Git Normal Commands
git status # Show the status of tracked and untracked files
git status -s # Show the status of files in a shorter format
git add .# Stage all modified files
git commit -m "<commit_message>"# Commit all staged files
git commit -a -m "<commit_message>"# Stage all files and commit them
Git Restore Commands
git restore <file># Discard changes in the working directory for a specific file
git restore --staged <file># Unstage a file without affecting its content
git restore .# Restore all files to the last committed state
git restore --source=HEAD~1 <file># Restore a file to its state in the previous commit