← 返回命令列表

Linux command

hub-init 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Initialize repository and create on GitHub

hub init && hub create

Initialize with specific directory

hub init [directory]

说明

hub init creates a git repository as with git-init(1) and adds remote "origin" at "git@github.com:USER/REPOSITORY.git". With the -g flag, it also creates the GitHub repository. Typically used with hub create to initialize a local repository and create a matching GitHub repository in one workflow.

参数

-g
After initializing, create a "USER/REPO" repository on GitHub and add it as the "origin" remote.
--bare
Create bare repository.
-q, --quiet
Quiet mode.
--template _dir_
Use template directory.

FAQ

What is the hub-init command used for?

hub init creates a git repository as with git-init(1) and adds remote "origin" at "git@github.com:USER/REPOSITORY.git". With the -g flag, it also creates the GitHub repository. Typically used with hub create to initialize a local repository and create a matching GitHub repository in one workflow.

How do I run a basic hub-init example?

Run `hub init && hub create` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -g do in hub-init?

After initializing, create a "USER/REPO" repository on GitHub and add it as the "origin" remote.