We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
选择拥抱开源,无疑参与 github的开源项目是最好的选择,先从同步 fork 仓库开始做起!
github
commit
本地 clone 自己仓库 后的 commit log 日志,与 gihub 上一致
clone
commit log
比较后得知:本地 fork仓库的版本落后于原始仓库
fork
下一步计划,准备开始同步!
如果未连接上游仓库,添加远程仓库的变量地址
$ git remote -v origin https://github.com/xiaoyueyue165/taro.git (fetch) origin https://github.com/xiaoyueyue165/taro.git (push)
$ git remote add upsteream https://github.com/NervJS/taro.git
$ git remote -v origin https://github.com/xiaoyueyue165/taro.git (fetch) origin https://github.com/xiaoyueyue165/taro.git (push) upsteream https://github.com/NervJS/taro.git (fetch) upsteream https://github.com/NervJS/taro.git (push)
$ git fetch upsteream
默认情况下,git fetch 取回所有分支(branch)的更新
所取回的更新,在本地主机上要用"远程主机名/分支名"的形式读取。比如upsteream主机的master,就要用 upsteream/master 读取。
upsteream
master
upsteream/master
$ git merge upsteream/master
此时会发现本地 master 分支的 commit 日志已经与原仓库的日志保持一致
$ git push origin master
# 添加主仓库到 remote git remote add upstream git@github.com:vant-ui/vant.git # 拉取主仓库最新代码 git fetch upstream # 切换至 main 分支 git checkout main # 合并主仓库代码 git merge upstream/main # 发布到自己 fork 的项目,origin 是自己的源地址 git push origin main
同步 tag
# 同步分支后查看合并后分支的 tag 版本情况,会看到很多 upstream 源才有的 tag git tag # 上一步如果不对再获取一下(可省略) git fetch upstream --tag # 把 tag 同步到自己的源 git push origin --tags
The text was updated successfully, but these errors were encountered:
No branches or pull requests
前言
选择拥抱开源,无疑参与
github
的开源项目是最好的选择,先从同步 fork 仓库开始做起!一、确认本地 fork 仓库版本是否落后于原仓库
1. 查看 github fork 仓库后的
commit
数量及提交日志本地
clone
自己仓库 后的commit log
日志,与 gihub 上一致2. 查看原仓库的相关信息,比较
下一步计划,准备开始同步!
二、 同步
1. 查看本地仓库设置的远端仓库,是否有连接上游原始远端仓库
如果未连接上游仓库,添加远程仓库的变量地址
2. fetch,取回原仓库的更新
3. 将 fetch 后的更新内容合并至主分支
所取回的更新,在本地主机上要用"远程主机名/分支名"的形式读取。比如
upsteream
主机的master
,就要用upsteream/master
读取。此时会发现本地 master 分支的
commit
日志已经与原仓库的日志保持一致4.更新,推送至远端 master 分支
commit
数量与 最新日志与原仓库一致5. 同步远程的 tag
同步 tag
参考
The text was updated successfully, but these errors were encountered: