๐–„๐•บ๐ŸŒŽ๐•ฟ๐•ฝ๐•บยฅ

๐–„๐•บ๐ŸŒŽ๐•ฟ๐•ฝ๐•บยฅ

๐•ด ๐–‰๐–” ๐–’๐–†๐–Œ๐–Ž๐–ˆ
github

Beginner's Guide to Git Common Commands Summary

Git#

Git is an open-source distributed version control system. My understanding is that it is a tool for fetching files from a remote server to the local machine and supports uploading files from the local machine back to the server. It is widely used on platforms such as GitHub and GitLab. For example, it can be used by individuals to quickly upload files to the platform or by teams to upload code to a shared repository. The most important feature is that it shows the changes made to the files each time they are uploaded, making it convenient for teams to reference and use.

Most Common Commands#

git clone โ€”โ€” Clone files from the server to the local machine
git status โ€”โ€” Check and list modified files
git add {fileName}โ€”โ€” Commit changes
git add . โ€”โ€” Commit all changes
git commit -m '#' โ€”โ€” Add push comments #
git branch {branchName}  โ€”โ€” Create a new branch
git switch {branchName} โ€”โ€” Move to a branch
git switch {branchName}^ โ€”โ€” Move to the parent commit of a branch
git switch {branchName}~x โ€”โ€” Move x levels up from the branchName branch
git reset {branchName} โ€”โ€” Return to the branchName branch
git rebase {branchName} โ€”โ€” Merge changes based on the current branch
git merge {branchName} โ€”โ€” Merge the changes from the branch into the current branch

So what's the difference? Which one should you use?
git rebase VS git merge? A more elegant way to merge in git

git commit -m '#' โ€”โ€” Add push comments #
git push โ€”โ€” Push the modified files to the remote server
git pull โ€”โ€” Fetch updated files from the remote server to the local machine (assuming there are updates on the remote server)

Reference#

Git Reference https://git-scm.com/docs
Git Basic Operations | Runoob Tutorial https://www.runoob.com/git/git-basic-operations.html

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.