git工作流

zero-step

set teammate can just read

firts-step

create dev branch

second-step

fork team project to your own repository

third-step

clone project to local

git clone git@github.com:itLeeyw/Renaissance.git
git branch # view branches
git branch -a # view all local and remote branches
git checkout -b dev origin/dev # create a dev branch , clone remote dev to local, switch to local dev branch
ls / dir # view dev branch detail

fourth-step (Stay abreast of team projects)

git remote -v # 查看是否设置upstream
# origin  git@github.com:SethLee23/git-flow-1.git (fetch)
# origin  git@github.com:SethLee23/git-flow-1.git (push)

# git remote add upstream 团队项目地址
git remote add upstream git@github.com:SethTeam/git-flow.git

git remote -v
# origin  git@github.com:SethLee23/git-flow-1.git (fetch)
# origin  git@github.com:SethLee23/git-flow-1.git (push)
# upstream        git@github.com:SethTeam/git-flow.git (fetch)
# upstream        git@github.com:SethTeam/git-flow.git (push)

git fetch upstream # 获取团队项目最新版本
git merge upstream/dev # 将源分支(upstream/dev)合并到当前分支(dev)。

fifth-step (push change to your own project)

git push

sixth-step (pull request to your team project)

  • click 'Pull request' link
  • select base fork branch and head fork barnch, add some comment, review what you changed and then Create pull request

seventh-step

  • as a team leader, enter the team repo, view how many 'pull request'
  • select one of 'Pull requests'
  • pay attention to next two tips:
  1. the source branch and the target branch
  2. click the 'pull request' link, view what changed
  3. if ok, click 'Merge pull request'

关于 git 的一些操作

decrease [.git] dir size and numbers

git gc
  • merge local branch
# 1. set branch in local
git checkout -b lsq

# 2. save local branch and push to remote
git add .
git commit -m'RF#save local branch and push to remote'
git push origin lsq:lsq-remote

# 3. make pull-request on github or merge branch local (git push -u lsq:main)
# before merge local branch to remote,you should save it
git checkout main
git merge lsq
git status
git push origin main

github 团队管理合作流程参考

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Git 基础用法 SVN与Git(集中式VS分布式) 集中式 分布式 工作区 电脑中能够看到的目录就是工作区。 版...
    GeekerHua阅读 622评论 0 0
  • 多种多样的工作流使得在项目中实施Git时变得难以选择。这份教程提供了一个出发点,调查企业团队最常见的Git工作流。...
    JSErik阅读 4,483评论 2 8
  • 一、Gitflow工作流概述 工作流(Workflow),指“业务过程的部分或整体在计算机应用环境下的自动化”。是...
    大海螺Utopia阅读 1,289评论 4 3
  • 中心化的工作流 优势 首先它让每个开发者都有自己的本地的完整项目副本。隔离的环境使得每个开发都的工作独立于项目的其...
    zucchiniy阅读 199评论 0 0
  • 夜莺2517阅读 127,761评论 1 9