file-type

掌握Git Fork与Pull Request的基本步骤

ZIP文件

下载需积分: 5 | 2KB | 更新于2025-01-05 | 46 浏览量 | 0 下载量 举报 收藏
download 立即下载
一、Git Forking基本概念及操作步骤: 1. Forking(分叉)是分布式版本控制系统Git中的一个功能,允许用户在GitHub等平台上复制一个仓库到自己的账户下,进行修改而不影响原仓库。 2. 在实验室中,首先需要将CS-Queens-College-Yao账号下的“algos-lab-1”仓库派生到自己的GitHub账户中。 3. 派生后,需要在本地克隆该仓库。克隆是指复制远程仓库到本地计算机的过程。 4. 克隆仓库后,可以在本地编辑器中处理Java文件,编写代码时要遵循代码风格指南,并且为复杂的逻辑添加必要的注释。 二、Git Pull Requests(拉取请求)基本操作: 1. 当您在本地编辑器中完成Java文件的编写,并进行了必要的测试验证后,可以通过创建Pull Request的方式,向原始仓库提出合并您修改的请求。 2. 拉取请求是一种请求,向原始仓库的维护者表明,您已经对源代码做出了改进,并希望他们将这些改进合并到他们的代码库中。 3. 操作步骤如下: a. 在GitHub上,找到您 Fork 的仓库,点击“New pull request”按钮。 b. GitHub会自动比较原始仓库和您 Fork 的仓库之间的差异,并生成一个比较视图。 c. 检查差异后,点击“Create pull request”按钮,并为您的请求提供一个描述,解释您的修改和贡献。 d. 提交Pull Request之后,仓库的维护者可以审阅您的请求,并决定是否接受这个修改。 三、项目贡献流程: 1. 项目贡献流程通常包括Fork原始仓库,创建分支,提交更改,创建Pull Request,以及等待仓库维护者审查并合并您的更改。 2. 在本实验中,创建Pull Request后,还需要填写Google表单来正式提交您对项目的贡献。 四、Java文件编写要点: 1. 代码中应包含一个名为InThisStyle的变量,该变量名采用了蛇形命名法,这是Java中常用的一种变量命名规则。 2. 代码风格应清晰易懂,保持代码整洁和规范,便于其他开发者阅读和理解。 3. 在编写代码的过程中,应该注意编写清晰的注释,解释复杂或者不直观的代码段,为后期维护和更新提供便利。 五、文档撰写要点: 1. 需要准备一份名为“YourName_DP_Writeup.pdf”的文档,详细描述解决问题的思路、方法和结果。 2. 文档应包含必要的图纸和图表来辅助说明问题解决方案,使文档内容更加直观易懂。 3. 在撰写文档时,应确保文章结构清晰,语言表达准确,逻辑性强,便于其他同学或项目参与者理解您的解决方案。 六、Lab-1资源: 1. 实验室资源文件的压缩包名称为“algos-lab-1-master”,这是实验过程中所用到的仓库压缩包。 2. 该压缩包应包含所有相关文件,包括Java源文件以及相关的文档和图纸。 3. 在实验开始之前,确保已经从GitHub上成功克隆该压缩包到本地计算机,以便开始编码和文档撰写工作。 通过以上步骤,可以了解到在进行软件开发和协作时,如何使用Git进行源代码管理,包括派生仓库、克隆仓库、编写代码、提交更改、创建拉取请求以及撰写文档等操作。这些技能在软件工程和团队协作中是基础且至关重要的。

相关推荐

filetype

我把日志级别改成了debug,首先权限,命令都是无问题,权限给的最高,命令我手动ssh登录控制台都可正常显示,也不会报错,但是这个程序命令执行在交换机后台日志看只正确了执行quit这条命令,其余都未执行,程序日志如下:2025-07-15 14:21:27,593 - DEBUG - read_channel: 2025-07-15 14:21:29,594 - DEBUG - read_channel: 2025-07-15 14:21:29,594 - DEBUG - write_channel: b'quit\n' 2025-07-15 14:21:29,594 - DEBUG - EOF in transport thread 2025-07-15 14:21:29,595 - INFO - 172.17.201.28 不是已知汇聚交换机,作为最终设备 2025-07-15 14:21:29,608 - DEBUG - starting thread (client mode): 0x7a64f2f0 2025-07-15 14:21:29,608 - DEBUG - Local version/idstring: SSH-2.0-paramiko_3.5.1 2025-07-15 14:21:29,609 - DEBUG - Remote version/idstring: SSH-1.99-Comware-5.20 2025-07-15 14:21:29,609 - INFO - Connected (version 1.99, client Comware-5.20) 2025-07-15 14:21:29,631 - DEBUG - === Key exchange possibilities === 2025-07-15 14:21:29,631 - DEBUG - kex algos: diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1 2025-07-15 14:21:29,631 - DEBUG - server key: ssh-rsa 2025-07-15 14:21:29,631 - DEBUG - client encrypt: aes128-cbc, 3des-cbc, des-cbc 2025-07-15 14:21:29,631 - DEBUG - server encrypt: aes128-cbc, 3des-cbc, des-cbc 2025-07-15 14:21:29,631 - DEBUG - client mac: hmac-sha1, hmac-sha1-96, hmac-md5, hmac-md5-96 2025-07-15 14:21:29,631 - DEBUG - server mac: hmac-sha1, hmac-sha1-96, hmac-md5, hmac-md5-96 2025-07-15 14:21:29,631 - DEBUG - client compress: none 2025-07-15 14:21:29,631 - DEBUG - server compress: none 2025-07-15 14:21:29,631 - DEBUG - client lang: <none> 2025-07-15 14:21:29,631 - DEBUG - server lang: <none> 2025-07-15 14:21:29,631 - DEBUG - kex follows: False 2025-07-15 14:21:29,631 - DEBUG - === Key exchange agreements === 2025-07-15 14:21:29,631 - DEBUG - Kex: diffie-hellman-group-exchange-sha1 2025-07-15 14:21:29,631 - DEBUG - HostKey: ssh-rsa 2025-07-15 14:21:29,631 - DEBUG - Cipher: aes128-cbc 2025-07-15 14:21:29,631 - DEBUG - MAC: hmac-sha1 2025-07-15 14:21:29,632 - DEBUG - Compression: none 2025-07-15 14:21:29,632 - DEBUG - === End of kex handshake === 2025-07-15 14:21:29,655 - DEBUG - Got server p (2048 bits) 2025-07-15 14:21:30,462 - DEBUG - kex engine KexGex specified hash_algo <built-in function openssl_sha1> 2025-07-15 14:21:30,462 - DEBUG - Switch to new keys ... 2025-07-15 14:21:30,463 - DEBUG - Adding ssh-rsa host key for 172.17.201.28: b'5e3ca5910d7cce29466ca9634fce6a23' 2025-07-15 14:21:30,486 - DEBUG - userauth is OK 2025-07-15 14:21:30,506 - INFO - Authentication (password) successful! 2025-07-15 14:21:30,507 - DEBUG - [chan 0] Max packet in: 32768 bytes 2025-07-15 14:21:30,528 - DEBUG - [chan 0] Max packet out: 32496 bytes 2025-07-15 14:21:30,528 - DEBUG - Secsh channel 0 opened. 2025-07-15 14:21:30,532 - DEBUG - [chan 0] Sesch channel 0 request ok 2025-07-15 14:21:30,536 - DEBUG - [chan 0] Sesch channel 0 request ok 2025-07-15 14:21:30,536 - DEBUG - write_channel: b'\n' 2025-07-15 14:21:30,638 - DEBUG - read_channel: ****************************************************************************** * Copyright (c) 2004-2013 Hangzhou H3C Tech. Co., Ltd. All rights reserved. * * Without the owner's prior written consent, * * no decompiling or reverse-engineering shall be allowed. * ****************************************************************************** <CDSL_SW201.28_LBG> 2025-07-15 14:21:30,638 - DEBUG - Pattern found: (to continue|[>\]]) ****************************************************************************** * Copyright (c) 2004-2013 Hangzhou H3C Tech. Co., Ltd. All rights reserved. * * Without the owner's prior written consent, * * no decompiling or reverse-engineering shall be allowed. * ****************************************************************************** <CDSL_SW201.28_LBG> 2025-07-15 14:21:30,939 - DEBUG - read_channel: <CDSL_SW201.28_LBG> 2025-07-15 14:21:30,939 - DEBUG - Clear buffer detects data in the channel 2025-07-15 14:21:31,540 - DEBUG - read_channel: 2025-07-15 14:21:31,540 - DEBUG - write_channel: b'\n' 2025-07-15 14:21:31,540 - DEBUG - read_channel: 2025-07-15 14:21:31,551 - DEBUG - read_channel: <CDSL_SW201.28_LBG> 2025-07-15 14:21:31,551 - DEBUG - Parenthesis found in pattern. pattern: (>|\]) This can be problemtic when used in read_until_pattern(). You should ensure that you use either non-capture groups i.e. '(?:' or that the parenthesis completely wrap the pattern '(pattern)' 2025-07-15 14:21:31,551 - DEBUG - Pattern found: (>|\]) <CDSL_SW201.28_LBG> 2025-07-15 14:21:31,852 - DEBUG - read_channel: 2025-07-15 14:21:31,852 - DEBUG - [find_prompt()]: prompt is <CDSL_SW201.28_LBG> 2025-07-15 14:21:31,852 - DEBUG - In disable_paging 2025-07-15 14:21:31,852 - DEBUG - Command: screen-length disable 2025-07-15 14:21:31,852 - DEBUG - write_channel: b'screen-length disable\n' 2025-07-15 14:21:31,852 - DEBUG - read_channel: 2025-07-15 14:21:31,863 - DEBUG - read_channel: s 2025-07-15 14:21:31,874 - DEBUG - read_channel: 2025-07-15 14:21:31,885 - DEBUG - read_channel: creen-length disable 2025-07-15 14:21:31,896 - DEBUG - read_channel: 2025-07-15 14:21:31,907 - DEBUG - read_channel: ^ % Unrecognized command found at '^' position. <CDSL_SW201.28_LBG> 2025-07-15 14:21:31,907 - DEBUG - Pattern found: (CDSL_SW201\.28_LBG) screen-length disable ^ % Unrecognized command found at '^' position. <CDSL_SW201.28_LBG 2025-07-15 14:21:31,907 - DEBUG - screen-length disable ^ % Unrecognized command found at '^' position. <CDSL_SW201.28_LBG 2025-07-15 14:21:31,907 - DEBUG - Exiting disable_paging 2025-07-15 14:21:31,907 - INFO - 成功连接 172.17.201.28 2025-07-15 14:21:31,907 - DEBUG - write_channel: b'screen-length disable\n' 2025-07-15 14:21:32,008 - DEBUG - read_channel: screen-length disable ^ % Unrecognized command found at '^' position. <CDSL_SW201.28_LBG> 2025-07-15 14:21:32,108 - DEBUG - read_channel: 2025-07-15 14:21:34,109 - DEBUG - read_channel: 2025-07-15 14:21:34,610 - DEBUG - write_channel: b'system-view\n' 2025-07-15 14:21:34,711 - DEBUG - read_channel: system-view ^ % Unrecognized command found at '^' position. <CDSL_SW201.28_LBG> 2025-07-15 14:21:34,812 - DEBUG - read_channel: 2025-07-15 14:21:36,813 - DEBUG - read_channel: 2025-07-15 14:21:37,814 - INFO - 172.17.201.28 是 H3C V5 交换机,使用特殊绑定流程 2025-07-15 14:21:37,814 - DEBUG - write_channel: b'display mac-address 6c0b-5e47-7f89\n' 2025-07-15 14:21:37,915 - DEBUG - read_channel: display mac-address 6c0b-5e47-7f89 ^ % Unrecognized command found at '^' position. <CDSL_SW201.28_LBG> 2025-07-15 14:21:38,016 - DEBUG - read_channel: 2025-07-15 14:21:40,018 - DEBUG - read_channel: 2025-07-15 14:21:40,018 - INFO - MAC地址查询结果: ^ % Unrecognized command found at '^' position. 2025-07-15 14:21:40,018 - ERROR - 在 172.17.201.28 上未找到 MAC 6c0b-5e47-7f89 对应的端口 2025-07-15 14:21:40,019 - DEBUG - write_channel: b'\n' 2025-07-15 14:21:40,120 - DEBUG - read_channel: <CDSL_SW201.28_LBG> 2025-07-15 14:21:40,221 - DEBUG - read_channel: 2025-07-15 14:21:42,222 - DEBUG - read_channel: 2025-07-15 14:21:42,222 - DEBUG - write_channel: b'quit\n' 2025-07-15 14:21:42,222 - DEBUG - EOF in transport thread

许吴倩
  • 粉丝: 34
上传资源 快速赚钱