Instruction Documentation.
-
git initInitialize a new Git repositody -
git cone <repo-url>Clone a Repo from URL
git statusShow changes statusgit addAdd changes to Staginggit commit -m "Commit message"Commit changes with a messagegit logView commit history
git branchList of branchesgit branch <branch name>create a new branchgit checkout <branch name>Switch to branchgit merge <branch-name>Merge changes from a branchgit branch -d <branch name>
git remoteList of remotesgit remote add <name> <url>add a remotegit push <remote> <branch>push changes to a remotegit pull <remote> <branch>Pull changes form a remote
git pullfetch and merge changesgit fetchfetch changes without merginggit reset --hard HEADDiscard changesgit revert <commit-hash>Revert changes in a commit
git config --global user.name
git config --global user.email
git config --global user.name <name>
git config --global user.email <your-email>
git config user.name <name>
git config user.email <your-email>
..or create a new repository on the command line
git init
git add README.md
git commit -m "Commit message"
git branch -M main
git remote add origin <rep link>
git push -u origin main
...or push an existing repository from the command line
git remote add origin <rep link>
git branch -M main
git push -u origin main