fork、clone、add remote和branch一个github repo

fork-github-repo的Python项目详细描述


fork a github repo,将该repo克隆到本地目录,添加 上游远程,创建可选的功能分支并签出 分支

用法

usage: fork-github-repo [-h] [-c CONFIG] url [branch]

Fork a GitHub repo, clone that repo to a local directory, add the upstream
remote, create an optional feature branch and checkout that branch

positional arguments:
  url                   GitHub URL of the upstream repo to fork
  branch                Name of the feature branch to create

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Filename of the yaml config file (default :
                        ~/.github/fork_github_repo.yaml)

The config file with a default location of
~/.github/fork_github_repo.yaml contains the following settings:

-  github_token : The `GitHub personal access token with the public_repo scope
   allowed.
   https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
-  repo_dir : The directory path to the directory containing all your cloned
    repos. If this isn't defined, /tmp is used.

The file is YAML formatted and the contents look like this :

github_token: 0123456789abcdef0123456789abcdef01234567
repo_dir: ~/Documents/github.com/example/

配置

默认位置为的配置文件 ~/.github/fork_github_repo.yaml包含以下设置。

  • github_token:这个GitHub personal access token 允许使用public_repo作用域
  • repo_dir:指向包含所有 你的克隆回购协议。如果未定义,则使用/tmp

示例

叉匙刀

$ fork-github-repo https://github.com/octocat/Spoon-Knife
Forked https://github.com/octocat/Spoon-Knife to git@github.com:gene1wood/Spoon-Knife.git
Cloned git@github.com:gene1wood/Spoon-Knife.git to /path/to/gene1wood/Spoon-Knife
Remote "upstream" created for https://github.com/octocat/Spoon-Knife
Remote "upstream" fetched

叉勺刀,创建一个名为“我的功能”的功能分支

$ fork-github-repo https://github.com/octocat/Spoon-Knife my-feature
Forked https://github.com/octocat/Spoon-Knife to git@github.com:gene1wood/Spoon-Knife.git
Cloned git@github.com:gene1wood/Spoon-Knife.git to /path/to/gene1wood/Spoon-Knife
Remote "upstream" created for https://github.com/octocat/Spoon-Knife
Remote "upstream" fetched
Branch "my-feature" created
Branch "my-feature" pushed to origin
Tracking branch "origin/my-feature" setup for branch "my-feature"
Branch "my-feature" checked out

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java的目标是从我的项目中删除不起作用的文件   java对for循环的理解   java我完成了在作业要求的位置查找字符的部分,但是如何从我找到的字符串中删除字符呢?   基于帧时的java动画   java请求无效。缺少XGoogUploadCommand标头   java如何在viewsource模式下使用openStream?   grpc grpc_ARG_KEEPALIVE_PERMIT_而不调用java服务器?   java如何通过Junit测试Web服务调用   如何在java中获取鼠标中键?   使用junit在spring测试中加载属性文件   Java中用于类的类修饰符   java多色文本图像   sql无法调试Java中的“连接到数据库失败”异常   java如何指定hibernate连接映射?   java Android工具栏不显示   java仿射转换不同的图形对象   使用终端的java问题   Java在tomcat上查找127.0.0.1失败