This article brings you relevant knowledge about Git, mainly the compilation of git tutorial notes, including version controller methods, installation, basic operations and operating instructions, etc. I hope Helpful to everyone.
Recommended study: "Git Tutorial"
Backup code restoration collaborative development traceability code issues
—
Set up email
Whether the setting is successful
2) Enter this directory and right-click to open the Git bash window
3) Execute the command
git init 4) After the creation is successful, you can see the hidden .git directory under the folder
You can view the basic operations of
Part 4 later
git branch View branch
git branch nameCreate name branch
git checkout branch name Switch branch
git checkout -b Branch name Create and switch
git merge Branch name 1 Merge branch Branch 1 merges with the current branch
If
different branches conflict: they will not be merged automatically , storing different versions of information in files requires manual selection
git branch -d nameDelete name branch
-DForce deletion
1) Open the gitee web page to log in - create a new warehouse -
2) Configure the SSH public key:
in bash (continuous Press Enter to automatically overwrite if the public key already exists)
Get the public key - copy the output public key - open gitee's user-settings-SSH Public key
Note that you need to
before this git init
It will be successful if the name you set appears
Note that you must submit it in the local warehouse before doing this
The complete code is
[-f]: Force overwriting of remote codegit clone <warehouse path> [Local path]</warehouse>
git fetch [remote name] [ branch name]
git merge [remote name]
git pull [remote name] [branch name]
That is, grab and mergeI haven’t used idea
Created before Except for the .git file, other files in the folder are our working directory. Modify files (add, delete, update) in the working directory. The status of these modifications will change as we execute Git commands git add
: Create a new file from scratch (Not tracked) or modify an existing file (not staged) Use the git add
command to save the file to the staging area. (Workspace - Staging area) git commit
: The staging area enters the warehouse and generates a commit record. (Staging area - warehouse) git commit -m "Comment content"
git status
: View the status of the working directory and staging areagit log
: View the history of commits
git reset --hard commitID
: Version rollback
You can use git -log or git log command to view the commitIDtouch .gitignore
Add the file name that you do not want to participate in the update, and you can no longer participate in the warehouse management
Recommended learning: "Git Learning Tutorial》
The above is the detailed content of Git tutorial notes organization (summary sharing). For more information, please follow other related articles on the PHP Chinese website!