[英]Cannot add origin to my new git repository
I have created a git repository and want to add some code files to it. 我创建了一个git存储库,并想向其中添加一些代码文件。 I'm using git bash of Windows version.
我正在使用Windows版本的git bash。 I ran these lines
我跑了这些线
git init
git status
This showed all files as none of them were tracked. 这显示了所有文件,因为没有文件被跟踪。 Then
然后
git add .
git commit "my_commit"
git remote add origin https://github.com/userName/FileName.git
By running this command, got the following error 通过运行此命令,得到以下错误
bash: $'\302\226git': command not found
I have checked the path by running in cmd 我已经通过在cmd中运行检查了路径
git --version
That resulted: 结果是:
git version 2.20.1.windows.1
You have a strange character between the command prompt and the git
command. 您在命令提示符和
git
命令之间有一个奇怪的字符。 Remove it either moving the cursor to the g
of git
and hitting backspace several times, or yo can also: 删除它,或者将光标移动到
git
的g
并按退格键几次,或者也可以:
vi mode
(supposing you are working with git bash
): set -o vi
vi mode
(假设您正在使用git bash
): set -o vi
Esc
and the v
key. Esc
和v
键。 A vi
screen will open letting you edit the command. vi
屏幕,供您编辑命令。 :wq
. :wq
保存。 The command should execute normally.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.