小编pjg*_*ing的帖子

终端中的“git init -b <branch name>”命令引发“未知开关”错误

我正在尝试使用命令行将现有项目添加到 GitHub。我在终端的相关工作目录中,正在尝试使用该git init -b main命令。

最初,我收到与 xcode 相关的错误:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Run Code Online (Sandbox Code Playgroud)

我尝试过,xcode-select --install但更新服务器上的软件不可用,所以我从https://developer.apple.com/download/more/下载了“Xcode 12 的命令行工具” 。

现在进入git init -b main我得到以下信息:

error: unknown switch `b'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]

--template <template-directory>
                      directory from which templates will be used
--bare                create a bare repository
--shared[=<permissions>]
                      specify that the git repository is to be shared amongst several users
-q, --quiet           be …
Run Code Online (Sandbox Code Playgroud)

git xcode macos-catalina

25
推荐指数
4
解决办法
2万
查看次数

标签 统计

git ×1

macos-catalina ×1

xcode ×1