我正在尝试使用命令行将现有项目添加到 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)