[GitHub] LEVEL 2 Single Repository Workflows

2.2 Pull Requests Within a Repository

We're going to "come to you" and collaborate on your fork of the "dojo_rules" repository. To start out, we'll try doing some work on a local branch with a pull request.

1. Add a collaborators. "Settings --> Collaborators"

 

2. Create a branch of the "dojo_rules" repository locally and name it "deadly_skills". Push it up to GitHub. At this point, the branch will have the same content as the master branch.

$git branch -b deadly_skills

[deadly_skills] $git push origin deadly_skills

 

3. On your "deadly_skills" branch, open up your introduction file and modify it to include a list of your deadly skills (for example: Git, JavaScript, Ruby). Since this file is Markdown, you can specify these one per line starting the line with a * to make them into a list.

Add, commit and push your changes up to GitHub. Be sure to push to the remote branch with the same name as your local branch – deadly_skills.

dojo_rules$ git commit -am "Added deadly skills"
dojo_rules (deadly_skills)$ git push origin deadly_skills

 

4. Create a pull request from your branch to your master. When you create a pull request by default it'll go from your master branch back to "deadlyvipers/dojo_rules". In this case though, we want the pull request to go from "dojo_rules/deadly_skills" to "dojo_rules/master" – both in your repository.

To do this, create a pull request and click "Edit" at the top. Make sure the base is your master and the "compare" is your "deadly_skills" branch. This should show all of the changes you made on your branch.

 

 3 Merge the pull request.

 

Closing Pull Requests by Merging

复制代码
Start by getting all changes on GitHub on your master branch:

dojo_rules (deadly_skills)$ git checkout master
dojo_rules (master)$ git pull
Next, merge in the using the no-ff option.

dojo_rules (master)$ git merge --no-ff deadly_skills -m "Merging in deadly_skills"
Force push it to GitHub:

dojo_rules (deadly_skills)$ git push


git checkout master
git pull
git merge --no-ff deadly_skills
git push
 
复制代码

 

posted @   Zhentiw  阅读(255)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示