Dev for next development
Common commands:
Git config--global user.name git config--global color.status auto git config--global color.diff auto git remote-v/ / View the git path of a remote branch
all files of staging area, canceling all local modifications, is a dangerous operation Git cleanDelete Local redundant directories and files Git clean-nd, which shows what to delete, but is pre-deleted Git clean-fd, forcing the removal of redundant files and directories git rmThe RM command deletes files that have bee
processed
Git push Origin branch name
11. Submit the Merge Request
After submitting the merge request, the code approval team colleagues will review the submitted code, and no problem will agree to merge requests and merge the code from the test branch into the master branch
Git using tips
The use of Stash
Sometimes there is a scenario where you develop a feature on a local branch and ther
. Git is free software.5
HEADThe point is the current version, so git allows us to navigate between versions of history, using commands git reset --hard commit_id .
Before you travel, git log you can view the commit history to determine which version to fallback
the last commit information for each branchgit br--merged # View branches that have been merged into the current branchgit br--no-merged # View branches that have not been merged into the current branchGit Co Git co-b git co-b Git Co $id # Checkout A history commit record, but without branching information, switching to another branch will automatically deleteGi
information for each branchgit br--merged # View branches that have been merged into the current branchgit br--no-merged # View branches that have not been merged into the current branchGit Co Git co-b git co-b Git Co $id # Checkout A history commit record, but without branching information, switching to another branch will automatically deleteGit co $id-B
is deleted from the real meaning.$ git commit-m "delete files (using:git rm)"Do not worry, however, that the file was only deleted in the latest submission of the repository and is still in the history submission. You can view a list of the historical versions of a file by following the commands below.$ git ls-files--
TIG instead of diff and Log,brew install TIG on your MacGit Local Branch ManagementView, toggle, create, and delete branchesGit br-r # View Remote Branchgit br Git br-v # View the last commit information for each branchgit br--merged # View branches that have been merged into the current branchgit br--no-merged # View branches that have not been merged into the current branchGit Co Git co-b
Remote Branchgit br Git br-v # View the last commit information for each branchgit br--merged # View branches that have been merged into the current branchgit br--no-merged # View branches that have not been merged into the current branchGit Co Git co-b git co-b Git Co $id # Checkout A history commit record, but witho
First, create a new code base
# Create a new Git codebase in the current directory
$ git init
# Create a new directory and initialize it to git code base
$ git init [project-name]
# Download a project and its entire code history
$ git clone [url]
Second, the configurat
information for each branchgit br--merged # View branches that have been merged into the current branchgit br--no-merged # View branches that have not been merged into the current branchGit Co Git co-b git co-b Git Co $id # Checkout A history commit record, but without branching information, switching to another branch will automatically deleteGit co $id-B
the last commit information for each branchgit br--merged # View branches that have been merged into the current branchgit br--no-merged # View branches that have not been merged into the current branchGit Co Git co-b git co-b Git Co $id # Checkout A history commit record, but without branching information, switching to another branch will automatically deleteGi
The following are common commands used by git, which roughly summarize the following. Many Commands are used for Version Control Using git, but the common commands are also within the scope of the brain, share your summary with you.
1. Create a
Git branch view all local branches git status View current status git commit commit git branch-a view all branches git branch-r view all branches git commit-am "Init" commit and raise Release
. Remove the file from index, but keep the contents of the file and the changesgit rm--cached--A.CSS3. Delete folders with files (all files not changed)Git rm-r folder4. Forcibly delete the folder (used if the file contains changes)Git rm-r-F folder5. Fetch and merge from another warehouse or local branchGit pull Origin MasterExplanation: Origin is a repository name and master is a branch.Branch 1.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.