Submitting a PR record to an open source project for the first time in my life

I have known git for a long time, but I have never submitted a PR to a larger project. I have been messing around all by myself. Let’s record the process of submitting a PR for an open source project. For the omitted process, you can refer to: https://www.runoob.com/git/git -tutorial.html, this includes installation, use, and introduction basically;=

1. Preconditions

Precondition 1 : Install git on the local computer and set the Git user name and email address:
git config --global user.name "Github user name"
git config --global user.email "Github's registered email address"

Precondition 2 : Register a Github account and set up sshkey for transmission

2. Specific steps

Step 1. Fork the project.
Log in to your GitHub account, enter the corresponding project warehouse, and click fork.

Step 2. Clone the project.
Create a new folder on your local computer, enter the git bash terminal, and copy the project URL address.

git clone 项目URL地址 

Step 3. Establish a connection.
Add a remote warehouse named origin to the current Git warehouse. Its URL is the project URL address.

git remote add origin 项目URL地址
#检查是否建立远程连接
git remote -v  

Step4. Switch to the corresponding branch to make modifications.

# 查看已有分支
git branch -a
# 切换分支
git checkout 分支名
# 拉起名为origin的远程仓库中的dev分支的代码进行同步
 git fetch origin dev  

Step5. Submit local code to Github repository

# 添加当前目录文件到暂存区
git add .
# 将暂存区内容添加到仓库中
git commit -m "提交说明" 
# 将本地分支提交到远程仓库中,origin是刚才自己定义的远程分支名,本地分支名和远程分支名相同可以省略:及其以后的内容
git push origin <本地分支名>:<远程分支名>

When pushing, you need to enter your GitHub username and password to log in to your GitHub account.

Step6. Submit PR

Click on the code you just pushed in GitHub to pr

3. Finally

This is the first time to submit a PR to a formal large open source project, hoping to be merged, praying...

Guess you like

Origin blog.csdn.net/BinBinCome/article/details/132818385