当前位置:网站首页>Open source warehouse contribution - submit pr
Open source warehouse contribution - submit pr
2022-06-29 17:16:00 【Hua Weiyun】
Record the first pull request By merge The process of
order
I was shopping the other day Github when , Found an interesting project Github Roaming guide , The author is very experienced , Tell us how to use... With your own experience Github And how to find good projects , Interested friends can read and learn
Because I didn't download other special formats to read , Instead, it adopted Read online The way , But in the process, I found a lot of problems , The reading experience is terrible
- Cannot return to top
- The sidebar does not have a hierarchical directory to display
- Reading records cannot be saved ( Every time you open it, you need to find it from the beginning )
So I wanted to do something for this project
Modify page layout
docsify Introduce
Looked up a lot of information , At last I found docsify, Such a document artifact , The following introduction comes from Official documents
docsify Is a magical document website generator . He can quickly help you generate document websites . differ GitBook、Hexo Where it doesn't generate static .html file , All conversion work is done at run time . If you want to start using it , Just create one index.html You can start to document and deploy directly to GitHub Pages .
Installation pit
People are using commands
npm i docsify-cli -g Global installation docsify-cli Tool time , If you are installing node.js The default path was modified during : node_global and node_cache , Errors may occur after running the global install command , Here you need to find the default script docsify.cmd , Add its path to the environment variable

Avoid that the subsequent system cannot recognize docsify command , Let's configure the others according to the document , If you need to completely uninstall and reinstall , Please use the command
npm uninstall -g docsifyApplication effect

What about? , Is it very simple , You are in love with reading documents ? If you are interested , Sure Click here Read online
PR The process
Warehouse source
First fork Warehouse

then clone To local , Recommended installation github desktop Tools , Click me to download , Open with a local editor

Default vscode

Create an empty branch
Create a new branch , Used to add the functions you want to achieve , Here I choose to create a new Empty branch , Because the changes are big , You don't have to delete... Step by step
Use git checkout in -orphan Parameters :
git checkout --orphan emptybranch This command generates a file named emptybranch The branch of , This branch will contain all the files of the parent branch . But the new branch will not point to any previous commit , No history , Your current submission will be the first submission record of the branch
Delete all files
git rm -rf . // It ends with . If no documents are submitted , You cannot view branches , So we create a new file , And then submit
echo '# creat new branch' >> README.mdgit add README.mdgit commit -m 'creat new branch'push To remote warehouse , Complete the creation of empty Branch
git push origin emptybranchLocal modification
There is no detailed explanation here , Mainly for application docsify As an example PR The process , according to file Configure the local environment
Release branch
Publish branch after local preview is correct , We are github desktop Can be easily done in

Because I have submitted , You're not going back to show
merge branch
We have implemented the desired function in our empty Branch , however git Created in PR The request must have a parent node , Otherwise there will be a ( There is no association between the branch you selected and the branch you want to merge ) Similar tips for , So we need to merge this empty branch into the original branch of the warehouse and then do PR
Switch to master Branch
git checkout masterPull the far end master, Keep up to date
git pull origin masterMerge empty branches into master
git merge emptybranchsolve merge branch error
When merging branches, you may encounter such errors
fatal: refusing to merge unrelated historiesThe main reason is that the two branches have not been contacted yet
We add... After the command of operation --allow-unrelated-histories To solve this error report , for example :
git merge emptybranch --allow-unrelated-historiesIn fact, you can also directly establish branch, There is no need to establish an empty Branch , Thus eliminating the need to solve
fatal: refusing to merge unrelated historiesWrong operation
establish PR
Now go back to the website and you clone The location of the warehouse , There will be hints Compare & Creat a pullrequest , Click to select the branch , Record the functions you implement , It's OK to wait for the owner of the warehouse to merge after confirming the correct submission
Or you can go directly to the source warehouse address to find PR entrance , Start to create

finish contributes
Put it here merge Screenshot after ,hah, I also thank the author very much ,PR address


Communicate with other developers in a technology community , Just like blogging can get some responses , We will all make continuous progress , Better than myself yesterday
It's great to see what you're doing recognized , Although I just made some simple changes with other tools . All in all ,Github There are really a lot of interesting things , You can also learn 《Github Roaming guide 》 To find something you like , The open source method is really good

边栏推荐
猜你喜欢

自旋电子学笔记-张曙丰

垃圾收集器

基于C语言开发实现的一个用户级线程库

Inheritablethreadlocal resolves message loss during message transmission between parent and child threads in the thread pool

【R语言数据科学】:文本挖掘(以特朗普推文数据为例)

Redis 原理 - Sorted Set (ZSet)

Naacl 2022 | distillation of machinetranslation SOTA model

Redis principle - sorted set (Zset)

手把手教你在windows上安装mysql8.0最新版本数据库,保姆级教学

NAACL 2022 | 机器翻译SOTA模型的蒸馏
随机推荐
卷妹带你学jdbc—2天冲刺Day1
Kali installation tutorial 2020
PCB板框的绘制——AD19
外部自动(PLC启动机器人)
Gradle下载慢或无法下载
基于汇编实现的流载体的LSB隐藏项目
Practice | extreme optimization of script errors - make script errors clear at a glance
Redis principle - sorted set (Zset)
Help MySQL data analysis with databend
在供应链场景应用中,供应链管理系统扮演什么角色?
机器学习8-人工神经网络
[untitled]
Kotlin basic grammar
C language microblog user management system
深度剖析monai(一) Data和Transforms部分
Advanced webgl performance optimization
When MySQL RDS is collected using Flink CDC, the datetime type field will be compared with the source table after collection
Inheritablethreadlocal resolves message loss during message transmission between parent and child threads in the thread pool
机器学习7-支持向量机
curl: (56) Recv failure: Connection reset by peer