从命令行创建本地和远程存储库
git-create-repo的Python项目详细描述
Git创建回购
从命令行创建本地和远程git存储库。此工具适用于python 3。
安装
pip install git-create-repo
或
python setup.py install
还要确保安装了git。
用法
git_create.py [-h] [-p] [-s] [-n NAME]
参数
-h, --help show this help message and exit
-p, --private private repository
-s, --ssh switching from https to ssh remote url. Using
git@github.com... instead of https://github.com...
-n NAME, --name NAME name of remote repository
确保将cd
放入要在其中创建存储库的正确文件夹中。
创建公共存储库
git_create
创建专用存储库
git_create -p
添加远程存储库名称
您可以使用-n
为远程存储库指定其他名称。否则将使用本地回购名称。
切换远程URL
默认情况下,远程是通过https添加的。如果设置了ssh密钥,可以通过添加-s
将其更改为ssh。
github用户名
该工具只是从git config user.name
获取用户名。如果您没有这个集合,工具会提示您预先输入它。
下一步
系统将提示您输入密码和说明。只需按
enter
即可跳过描述。如果您的密码不正确,系统将再次提示您。如果上述操作成功,您现在将在github帐户上创建一个存储库。
注
- 还建议您创建自己的
.gitignore
,这样您就可以忽略不希望预先提交的文件。否则所有文件都将提交。
开发
窗口
安装开发依赖项:
- 运行
build install
测试脚本
- 使用从
build test
生成的test
文件夹运行脚本。这是为了确保您的实际git存储库不会受到损害。
build test
生成的test
文件夹运行脚本。这是为了确保您的实际git存储库不会受到损害。其他构建目标用于上传到pypi。
Linux
安装开发依赖项
确保已安装GNU Make。你可以用sudo apt-get install make
安装这个。
要安装开发依赖项,请运行make install
。
测试脚本
- 使用从
make test
生成的test
文件夹运行脚本。这是为了确保您的实际git存储库不会受到损害。
确保已安装GNU Make。你可以用sudo apt-get install make
安装这个。
要安装开发依赖项,请运行make install
。
- 使用从
make test
生成的test
文件夹运行脚本。这是为了确保您的实际git存储库不会受到损害。
其他构建目标用于上传到pypi。
未来
- 其他使此工具更可用的功能。
- 请让我知道在问题标签。