当前位置:网站首页>How to submit a PR?【OpenHarmony Growth Plan】【OpenHarmony Open Source Community】
How to submit a PR?【OpenHarmony Growth Plan】【OpenHarmony Open Source Community】
2022-08-10 20:56:00 【Progressive small vegetable pig】
如何提交一个PR
如果你熟悉gitThe principle and thegitee上提交过代码,Then you can ignore this section basic content,But there are two important to note:
- 在你向OpenHarmonyCommunity code before you submit,务必先签署DCO
- Any local submission must increase the signature,git commitBe sure to carry-s参数
GIT的基本原理
关于gitThe history and principle of,The author found a introduce good article,大家可以参考:
对于初学者而言,People think of using the following chart to understand better.
- fork:Refers to copy a copy from the official website of warehouse into his own account under the warehouse,In this time node under the content are the same;The subsequent need to constantly done manually synchronize;
- clone:Refers to download from their own account under the warehouse to the local side;
- commit:To clone the code,According to the need to modify the correct some content or add new content、删除冗余内容,形成记录.
- push:To own revision submitted to my account under the warehouse;
- pr:To own revision from his own bank account presented under the warehouse to the official under the warehouse;
- merge:Refers to the official account of warehousecommiterAccept your modifications;
- fetch:Refers to the pull of the content of the official account warehouse to the local.
几个问题:
- Can be directly from the official account warehouseclone吗?
当然可以的,But in general it is difficult to direct access to the official accountpush的权限,所以建议先forkThen from his account under the warehouseclone. - How to keep your account warehouse and official account sync?
Can directly use the sync website;Another is the first on the map from the official warehousefetch一份,Then push warehouse to my account. - clone和forkIt is necessary to every time?
forkCan be understood as a server-side initialization copy,只需一次即可;cloneAn initialization from the server to the local copy,只需要一次即可.
PR实操
Basic tools and configure the environment
GIT工具
WINDOWSEnvironment recommends using the command line tools,如果你是MACOS或者Linux,I believe you will be more easy to use,此处不表,本文仅仅以WINDOWS环境介绍.
可以从git bash下载地址下载git bash工具并安装.
安装完毕之后,Right click on the can appear in your working foldergit bash.
点击启动git bash之后会进入一个linux终端的界面,This is our follow-up to modify the content from the local to the
GiteeOn the main battlefield of individual warehouse.
一些linux的基本命令(cd:切换目录;cat:See the file, etc)Can be used in the interface,使用help + The use of the command to view the specific.请记住,You can type the command in the first few characters and then usetab键补全,After all, your memory is not very good.
补充SSH公钥
使用SSH公钥可以让你在你的电脑和 Gitee 通讯的时候使用安全连接.
So how to get to usPC的SSH公钥呢?在桌面右键打开git bash
输入ssh-keygen.exe 并回车,再次回车,然后输入y,Continue to enter twice,It can generate personalSSHPublic key keep file.
git无法直接ctrl+c/v实现复制粘贴,But you can mouse oversshPublic key keep file(即Your public key has been saved in 后面的内容)然后右键Copy复制,PastePaste the realization of this function.
使用cat命令查看生成的id_rsa.pub文件,输入cat (右键Paste粘贴sshPublic key keep file)Press enter to view specific information.
从ssh-rsa开始,The whole period of selected and then copy,打开giteeWebsite in Settings to findssh公钥,Paste to determine the public key can be added to ourgitee账号中.
Configuration to submit information
我们向giteeIndividual warehouse submitted to modify the content,Need to tell everyone who submitted by these changes,Otherwise, how do you know what is a hero to the open source community out of the force.So, in order to avoid repeat every time input some information submitted(Personal account information),我们需要使用git bashUnified configuration of the submitted information.
首先,To remember their own personal space address,Can be seen on the web link on your home page.
打开git bash,依次输入以下命令并回车,The first two commands without reaction is proved successful.
git config --global user.name "xxxx" (配置用户名,xxxxFor the account user name,The personal space address)
git config --global user.email "[email protected]"
git config --list (查看配置情况)
恭喜你,Here is the smooth completion of contribute to the open source community to prepare!
Install code and document editingIDE
If you don't have a personal familiar tools,个人推荐使用OpenHarmony南向设备端IDE DevEcoTool作为我们的C/C++/MarkdownDocument editing tools,不然很多MD文档(程序员最爱)你都打不开.
IDE下载地址:
After download the corresponding version according to the installation guide for installation.
This is a giveVisual Studio Code的IDE,You can install a lot ofVS插件,For example, we modify the document commonly usedMarkdown.打开该IDE工具,In extensions searchMarkdown,安装Markdown All in one/Markdown preview enchance/Markdown PDF几个插件.
Let's field,进入PRDialogue trip
目标:Knowledge system joint operations team、Students held a knowledge infrastructure group can assign courses live,Live events have a clock in link after class,We have to make aPRMake a clock in motion.
Fork官方仓库
The official warehouse content synchronization to their own personal
Activity warehouse official address
fork之后,在我们的giteeAccount can be seen in the warehouse.
CloneWarehouse content to the local
Below the open to a personal account of the warehouse,进入到clone界面,复制clone的链接地址.
在gitbashTools used belowgit clone命令完成clone动作.–depth=1意思是只cloneThe latest version of the current warehouse,To avoid the warehouse record is too big spending too muchclone时间.
git clone https://gitee.com/Cruise2022/online_event.git --depth=1
clone完毕之后,Can see this in the local directoryclone的仓库.补充说明一下,Local directory location is based ongit bash的位置决定的,Such as your desktop in the startgit bash,则cloneThe warehouse will appear on the desktop.
编辑本地文件
In the local directory open phase six growth clock homework,Create a new clock in homework folder(It is recommended to use your owngiteePersonal space address to name their own clock in the homework folder,避免冲突),把readme.mdDocument is copied to the own clock homework folder,You can use just installedIDE编辑md文件,也可以使用其他的markdownEdit thismd文件(例如Typora)
提交修改到本地仓库
readme.mdModify complete attention to save after,然后开始使用gitCommand to view and submit.Need to be done in the local warehouse location at this timegit bash,不然gitCan't find our revised content.Submit the main steps are as follows:
- Check the file after the modification of change,输入以下命令查看
git status
- Add files after the modification of changes to the staging area,Enter the following command operation
git add *
- Commit changes after the change of the file to the local warehouse and signed,Enter the following command.
-sIs a signature shows that the submitter is you,-mIs submitted to the behavior of note,Tell everyone what you commit changes.
git commit -s -m "add:Knowledge can assign course sign in"
- 最后我们再用git status查看一下,To see is no modify change something there.
Push local warehouse new content to the accounts
- After completing the local commits,The changes will be saved to a local warehouse,并且形成了LOG.LOGMeans to submit records,All people in the warehouse operation will formLOG存储起来,Convenient fallback casually change.使用git logCommand to see the us the submission record.(输入git logAfter the command cannot enter other command,同时按ctrl+cCan exit to the.)
git log
- Now we need to modify the content of local warehouse push togiteeOn the personal warehouse,使用git pushOrder to complete the action.
git push origin master
- Into our account here,We have to look at the warehouse,Discovery has changed.
Presented under official from personal account under the warehouse to warehousePR
Enter the personal account under the warehouse,点击增加PRCan begin to submitPR.
Submitted can see we submittedPR了.
At this time is over?
No.我们需要在该PRAdd a comment,Entrance guard to check(A series of compliance of access control refers to the administrator to check,To test whether the code compliance,质量是否合格,Whether or not to signDCO协议).
然后我们就可以看到CIThe various compliance to begin,泡杯咖啡,Wait for check by,Then the warehouse administrator to merge(PS:Some commit because various reasons by the administrator refuses to,Mindful of the administrator reply in a timely manner to modify to resubmit)
至此,Congratulations on your success toOpenHarmonyThe open source community issued the first sound of his own!
虽然这只是一小步,But we believe it was a big step in the progress of community,期待你加入我们,Open source contributions together!
FAQ
I registered beforegitee,The use the new account,但是push的时候失败
现象如下:The specific reason is that wewindows的SSHThe credential may still keep the previous Settings,We need to manually change the credentials of articlegit:https://gitee.com.
visual studio code 安装完markdown相关的插件之后,没有预览功能
查看visual studio code是否处于Restricted Mode模式,看IDE界面的左下角,如果是,Click close to.在markdownInterface is right can appear preview function.
作业
Complete knowledge warehouse community communication(watch/fork/star)
Combined with his own perspective,提出问题(ISSUE)And its correction problem(PR)You can view the following warehouse
- Knowledge warehouse home page
- Knowledge system sample warehouse-智能家居场景
- Knowledge system sample warehouse-Entertainment scene
- Knowledge system sample warehouse-Shopping consumption scenarios
- Knowledge system sample warehouse-运动健康场景
- Knowledge system sample warehouse-Smart travel scene
- Knowledge system sample warehouse-Wisdom office scene
- Knowledge system sample warehouse-其他场景
- Knowledge warehouse system activity
边栏推荐
- idea插件 协议 。。 公司申请软件用
- 转铁蛋白(Tf)修饰去氢骆驼蓬碱磁纳米脂质体/香豆素-6脂质体/多柔比星脂质体
- 参天生长大模型:昇腾AI如何强壮模型开发与创新之根?
- cordova 安装错误 Command failed: powershell 解决方法
- LeetCode 1-10题
- servlet映射路径匹配解析
- 验证码倒计时自定义hooks
- 电信保温杯笔记——《统计学习方法(第二版)——李航》第17章 潜在语义分析
- Leetcode 200.岛屿数量 BFS
- @Autowired annotation --required a single bean, but 2 were found causes and solutions
猜你喜欢
Web3中值得关注的基础设施
[email protected]纳米模拟酶|PtCo合金纳米粒子"/>
水溶性合金量子点纳米酶|CuMoS纳米酶|多孔硅基Pt(Au)纳米酶|[email protected]纳米模拟酶|PtCo合金纳米粒子
leetcode 85.最大矩形 单调栈应用
Multifunctional Nanozyme Ag/PANI | Flexible Substrate Nano ZnO Enzyme | Rhodium Sheet Nanozyme | Ag-Rh Alloy Nanoparticle Nanozyme | Iridium Ruthenium Alloy/Iridium Oxide Biomimetic Nanozyme
设备管理中数据聚类处理
Transferrin-modified vincristine-tetrandrine liposomes | transferrin-modified co-loaded paclitaxel and genistein liposomes (reagents)
Knowledge map Knowledge Graph
三子棋的设计和代码
铁蛋白-AHLL纳米颗粒|人表皮生长因子-铁蛋白重链亚基纳米粒子(EGF-5Cys-FTH1)|铁蛋白颗粒包载氯霉素Chloramphenicol-Ferritin
XML小讲
随机推荐
【SemiDrive源码分析】【MailBox核间通信】52 - DCF Notify 实现原理分析 及 代码实战
Ferritin particle-loaded raltitrexed/pemetrexed/sulfadesoxine/adamantane (scientific research reagent)
leetcode 85.最大矩形 单调栈应用
[mysql] 深入分析MySQL版本控制MVCC规则
[CNN] Brush SOTA's trick
饿了么-机构树单选
血红素-金纳米颗粒(Heme-AuNP)复合纳米酶|金纳米颗粒核多孔空心碳纳米球壳([email protected])纳米酶
keepalived:故障检测自动修复脚本
cordova 安装错误 Command failed: powershell 解决方法
kuberentes Auditing 入门
2020 ICPC Shanghai Site G
MySQL数据库的主从复制部署详解
Pt/CeO2单原子纳米酶|[email protected] NPs纳米酶|碳纳米管负载铂颗粒纳米酶|白血病拮抗多肽修饰的FeOPtPEG复合纳米酶
A fullGC problem troubleshooting caused by groovy
链表应用----约瑟夫问题
电脑重装系统Win11格式化硬盘的详细方法
参天生长大模型:昇腾AI如何强壮模型开发与创新之根?
.NET现代应用的产品设计 - DDD实践
【图像分类】2019-MoblieNetV3 ICCV
mysql踩坑----case when then用法