22.3 如何参与 FreeBSD 开发
方法概述
git pull # 在当前分支下拉取远程更新
git checkout B # 切换到分支 B
git diff -U999999 origin/main > 2023-1-24.diff # 在分支 B 下生成与远程 main 分支的差异,并保存到 2023-1-24.diff 文件完整的操作示例
root@generic:~ # git clone https://github.com/ykla/freebsd-ports # 克隆 ykla/freebsd-ports 仓库到本地
you have mail
Cloning into 'freebsd-ports'...
remote: Enumerating objects: 6264931, done.
remote: Counting objects: 100% (15563/15563), done.
remote: Compressing objects: 100% (9249/9249), done.
remote: Total 6264931 (delta 6507), reused 14986 (delta 6260), pack-reused 6249368 (from 1)
Receiving objects: 100% (6264931/6264931), 2.12 GiB | 10.73 MiB/s, done.
Resolving deltas: 100% (3615966/3615966), done.
Checking objects: 100% (16777216/16777216), done.
Updating files: 100% (161546/161546), done.
root@generic:~ # cd freebsd-ports/
root@generic:~/freebsd-ports # git branch -a # 查看分支
* main
remotes/origin/HEAD -> origin/main
remotes/origin/main
remotes/origin/rpi-firmware
root@generic:~/freebsd-ports # git checkout rpi-firmware # 切换到 rpi-firmware 分支,这是我自己通过 Github 网页创建的分支
branch 'rpi-firmware' set up to track 'origin/rpi-firmware'.
Switched to a new branch 'rpi-firmware'
root@generic:~/freebsd-ports # git diff -U999999 origin/main > 2024.diff # 生成与远程 main 分支的差异,并保存到 2024.diff 文件中
root@generic:~/freebsd-ports # ls -l 2024.diff
-rw-r--r-- 1 root wheel 18021 Oct 6 03:59 2024.diff附录:一些可能用得到的命令
最后更新于