(1) Git clone server user name @ Server ip:~/git directory/.git
function: Download the file or directory in the server-side git repository to the local current directory.
(2) Modify the files in the Git directory.
(3) Git status
Features: View file modification status in the Git repository.
(3) git Add.
Function: Add a modified file or directory to your local git repository.
Add-
A file can be submitted in a separate fast zone. FileName is optional, and if not specified, Git iterates through all the unstage files.
(4) Git commit-m "comments"
Function: Commit to modify the file or directory to the local git repository.
(5) Git pull
Features: get the latest code from the GIT repository in the server and merge with native code automatically, if the code in the server conflicts with the code that is being submitted locally, the conflict section
will be reflected in the document.
(6) If there is conflict, modify.
(7) Git diff
Features: View the similarities and differences between the modified file and the files in the local git repository, i.e., what parts of the file you modified.
(8) Git push
Function: submit a modified file or directory from the local git repository to the server's Git repository.
Knowledge Points:
(1) Git checkout.
Features: Download the latest code from the server's Git repository and overwrite all local files, including those that have been modified.
(2) Show git configuration entries:
git config--global--list
(3) Configure user name:
git config--global user.name "user name".
(4) Configure the mailbox:
git config--global user.email mailbox.
(5) Configure aliases for commands:
git config--global alias.co checkout
(6) Show the details of a version change:
Git show version number.
(7) View the change log:
git log.
(8) Git fetch:
Getting the latest version from the remote server to local does not automatically merge with the local code (git pull = git fetch + git merge).
(9) View branches
Local branch: Git branch
Remote branch: Git branch-a
Create a branch: Git branch test
To push a branch to a remote branch: Git push Origin test
Switch branches to test:git checkout test
Delete local branch: git branch-d xxxxx
(10) View Source: Git remote-v
- Origin [email protected]:middleware/jingwei.git (FETCH)
- Origin [email protected]:middleware/jingwei.git (push)
To delete a file:
1. Git clean-df (Use caution)
2. Git Reset--hard
Download and submit the client git code