Summary of this week
study this week
- Master the learning method of git commands.
- Master the use of git commands in vscode.
Summary of knowledge points
what is git?
Git (pronounced /gɪt/) is an open source distributed version control system that can effectively and quickly handle project version management from small to very large. [1] It is also an open source version control software developed by Linus Torvalds to help manage Linux kernel development.
The four areas of git
- Workspace: The area where work is processed.
- Temporary storage area: The temporary storage area for completed work, waiting to be submitted.
- Local warehouse: The place where the data is stored, but it is still on the computer. If the computer storage space is damaged, the code will still disappear.
- git remote warehouse: the final storage area, remote server.
The four states of git
- Untracked: The file is not added to the git library, does not participate in version control, and becomes temporary storage with git add
- Staged: Indicates that the current version of the modified file has been marked to be included in the list for the next commit
- Modified: Indicates that the file has been modified, but the modified result has not been placed in the temporary storage area
- Committed: Indicates that the file has been safely saved in the local Git repository
logical relationship representation
git initialization and configuration instructions
instruction | use | How to use it in vscode |
---|---|---|
git clone | Download the code base from the server to the specified folder | Enter after Ctrl+Shift+P opens |
git config | Configure developer username and email | Enter after Ctrl+Shift+P opens |
git log | View version submission history | After installing Git history and Gitlens in the extension, just click and stay with the mouse |
git init | Initialize a Git repository | Enter after Ctrl+Shift+P opens |
Common git commands and their simple use in vscode
instruction | use | Simple use in vscode |
---|---|---|
git branch | View all local branches | The branch in the lower left corner of vscode |
git status | view current status | Explorer interface direct observation |
git commit | submit | Commit button in source control |
git branch -r | View remote branches | Check it after syncing |
git checkout -b/null | create and switch branch / switch branch | Click the branch button in the lower left corner to select the operation to be performed |
git add | scratch buffer | Click the "+" to the right of the changed file in source control |
git commit null/-m | Commit all changes/with comments for the current respos | Click the submit button to change the file to be tested in the source code management, and enter message |
git push (remote warehouse name) (branch name) | Push the local branch to the server | After submitting, click Sync Update |
git pull | Pull the latest code from the server | After submitting, click Sync Update |
git merge | Merge the branch, the code of the merged branch remains unchanged | Left-click on the branch symbol to select the merge branch option |
git reset --hard (version number) | Roll back the specified version |
git command chart and possible problems and solutions
markdown syntax rules
1. Title
To create a title, precede a word or phrase with a pound sign ( #
). #
The number represents the level of the title. For example, adding three #
means creating a three-level heading. Note that there #
is a space after it.
Markdown syntax | preview effect |
---|---|
# 示例 1 |
Example 1 |
## 示例 2 |
Example 2 |
### 示例 3 |
Example 3 |
#### 示例 4 |
Example 4 |
##### 示例 5 |
Example 5 |
###### 示例 6 |
Example 6 |
Second, wrap
Add two or more spaces at the end of the line and press Enter.
3. Font size and color
Grammar rules:
<font size=1>大小为1的字体</font>
<font size=6>大小为6的字体</font>
<font color=gray size=4>gray颜色的字</font>
<font color=green size=4>green颜色的字</font>
<font color=hotpink size=4>hotpink颜色的字</font>
<font color=LightCoral size=4>LightCoral颜色的字</font>
<font color=LightSlateGray size=4>LightSlateGray颜色的字</font>
<font color=orangered size=4>orangered颜色的字</font>
<font color=red size=4>red颜色的字</font>
<font color=springgreen size=4>springgreen颜色的字</font>
<font color=Turquoise size=4>Turquoise颜色的字</font>
The demonstration effect is as follows
Words in gray color
with font size 1 Words in green color Words in hotpink color Words in LightCoral colors Words in LightSlateGray color words in orangered color Words in red color Words in springgreen color Words in Turquoise color words
Separator, strikethrough, underline
分割线***
~~我有删除线~~
我没删除线
<u>我带下划线</u>
The demonstration effect is as follows
I have strikethrough
I don't strikethrough
I underline
markdown list
ordered list
1. 第一列
2. 第二列
3. 第三列
Preview effect:
- first row
- The second column
- third column
unordered list
+ 无序列表
* 无序列表
- 无序列表
Preview effect:
- unordered list
- unordered list
- unordered list
block
嵌套的格式都是,在使用完上面的一种格式之后,按回车键,然后再按 “Tab” 键即可生成;“Tab” 键具体按几下根据你嵌套的层次自己决定;
第一种:引用嵌套
>第一层嵌套
>>第二层嵌套
>>>第三层嵌套
第二种:有序列表嵌套
1. 第一列
1. 第一列的第一列
2. 第一列的第二列
2. 第二列
第三种:无序列表的嵌套
- 无序列表 1
- 无序列表 1 的无序列表 1
- 无序列表 1 的无序列表 2
- 无序列表 2
The first type: nested references
first level of nesting
second level of nesting
third level of nesting
The second: nested ordered list
- first row
- the first column of the first column
- the second column of the first column
- The second column
The third: Nesting of unordered lists
- unordered list 1
- unordered list 1 of unordered list 1
- Unordered List 2 of Unordered List 1
- unordered list 2
conclusion of issue
vscode
- error log
报错“无法推送refs到远端,您可以试着运行“拉取”功能,整合您的更改。”
- error analysis
- The conflict stems from putting the same project under different files. Make modifications to the file without pulling the code.
- Solution
- Just do a pull before pushing.
- References
perception
- Whether it is the learning of git commands or the learning of MD usage, I feel that the knowledge I personally have is only a drop in the bucket.
Error "Unable to push refs to the remote end, you can try to run the "pull" function to integrate your changes."
- 错误分析
- 该冲突源于同一个项目放到不同的文件下面。在未拉取代码的情况下对文件进行修改。
- 解决方法
- 在推送之前进行拉取即可。
- 参考资料
- [解决无法推送问题](http://t.csdn.cn/ezuuW)
## 感悟
- 不管是git指令的学习还是MD使用方法的学习都让我觉出来,我个人所掌握的知识仅仅是九牛一毛。