当前位置:网站首页>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
边栏推荐
猜你喜欢
Transferrin-modified vincristine-tetrandrine liposomes | transferrin-modified co-loaded paclitaxel and genistein liposomes (reagents)
leetcode 547.省份数量 并查集
爱丁堡大学最新《因果机器学习: 医疗健康与精准医疗应用》2022综述
Heme - gold nanoparticles (Heme - AuNP) composite nanometer enzyme | gold nanoparticles nuclear porous hollow carbon nanometer spherical shell (Au @ HCNs) nano enzyme
2020 ICPC Shanghai Site G
参天生长大模型:昇腾AI如何强壮模型开发与创新之根?
C语言系列——猜名次、猜凶手、打印杨辉三角
【语义分割】2016-SegNet TPAMI
图扑智慧电力可视化大屏,赋能虚拟电厂精准减碳
idea插件 协议 。。 公司申请软件用
随机推荐
组合导航精度分析
ctfshow-osint
不止跑路,拯救误操作rm -rf /*的小伙儿
Transferrin (TF) Modified Paclitaxel (PTX) Liposomes (TF-PTX-LP) | Transferrin (Tf) Modified Curcumin Liposomes
"POJ 3666" Making the Grade problem solution (two methods)
转铁蛋白Tf功能化β-榄香烯-雷公藤红素/紫杉醇PLGA纳米粒/雷公藤甲素脂质体(化学试剂)
【语义分割】2015-UNet MICCAI
烟雾、空气质量、温湿度…自己徒手做个环境检测设备
每日一R「03」Borrow 语义与引用
二级指针的简单理解
redis如何查看key的有效期
mysql踩坑----case when then用法
npm‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件
转铁蛋白(TF)修饰紫杉醇(PTX)脂质体(TF-PTX-LP)|转铁蛋白(Tf)修饰姜黄素脂质体
(十二) findContours函数的hierarchy详解
【CMU博士论文】视频多模态学习:探索模型和任务复杂性,152页pdf
win10 xbox录屏功能不能录声音怎么办
idea插件 协议 。。 公司申请软件用
饿了么-机构树单选
LeetCode 1-10题