【发布时间】:2018-02-04 17:02:08
【问题描述】:
无论我尝试什么,我都无法让它工作,我被告知要使用
git config --global user.name "Your Name"
git config --global user.email you@example.com
git commit --amend --reset-author:
但我总是到了一个我不知道自己在做什么的地方,甚至不知道如何安全地离开那个环境。
.git/ 位于我的 memory_game 文件夹中,其中包含我的项目代码。 memory_game 文件夹被保存——让我给你看:
~/fundamentals/memory_game
.git/ 应该放在基础而不是 memory_game 中吗?
我觉得如果我不小心行事,我可能会损坏系统。如果可以,请帮助我,我只是在努力学习。感谢您的时间!
以下是我最近的终端活动:
在主分支上
还没有提交
未跟踪的文件:(使用“git add ...”来包含将要跟踪的文件 承诺)
.DS_Store css/ images/ index.html js/ nothing added to commit but untracked files present (use “git add” to track)您的姓名和电子邮件地址是根据以下条件自动配置的 您的用户名和主机名。请检查它们是否准确。你 可以通过显式设置来抑制此消息:
git config --global user.name "Your Name" git config --global user.email you@example.com完成此操作后,您可以通过以下方式修复用于此提交的身份:
git commit --amend --reset-author 11 files changed, 202 insertions(+) create mode 100644 .DS_Store create mode 100644 css/style.css create mode 100644 images/.DS_Store create mode 100644 images/back.png create mode 100644 images/king-of-diamonds.png create mode 100644 images/king-of-hearts.png create mode 100644 images/queen-of-diamonds.png create mode 100644 images/queen-of-hearts.png create mode 100644 index.html create mode 100644 js/main.jsUser-MBP:memory_game user$ git push origin master
fatal: ‘origin’ does not appear to be a git repository fatal: Could not read from remote repository.请确保您拥有正确的访问权限和存储库 存在。
Users-MBP:memory_game usernameishere$ git status On branch master nothing to commit, working tree clean Users-MBP:~ username$ cd fundamentals Users-MBP:fundamentals username$ cd memory_gameUsers-MBP:memory_game 用户名$ ls -a
. .DS_Store css index.html … .git images jsUsers-MBP:memory_game 用户名$ git init
重新初始化现有的 Git 存储库 /Users/用户名/fundamentals/memory_game/.git/
Users-MBP:memory_game 用户名$ git status
在分支 master 上没有提交,工作树干净
【问题讨论】:
-
origin未设置,因为您尚未设置任何遥控器。你打算push去哪里?你需要为此设置一个遥控器。