Git 我使用MAC电脑,我被告知备份我的代码并跟踪我的工作

Git 我使用MAC电脑,我被告知备份我的代码并跟踪我的工作,git,macos,github,push,master,Git,Macos,Github,Push,Master,任务: 将代码推送到存储库 为了备份代码和跟踪工作,您需要将所做的更改提交到项目的存储库中。您必须将终端和cd打开到保存此分配的克隆存储库的正确文件夹中。到达后,您必须完成以下三个步骤: 1) 阶段化你的代码 git添加-a 2) 创建阶段代码的版本 git提交-m“创建的游戏逻辑” 3) 将代码推送到GitHub存储库 git推送源主机 我的最终结果是: Roberts-MacBook-Air:wdi-fundamentals-memorygame robert$ git add -a err

任务:

将代码推送到存储库

为了备份代码和跟踪工作,您需要将所做的更改提交到项目的存储库中。您必须将终端和cd打开到保存此分配的克隆存储库的正确文件夹中。到达后,您必须完成以下三个步骤:

1) 阶段化你的代码

git添加-a

2) 创建阶段代码的版本

git提交-m“创建的游戏逻辑”

3) 将代码推送到GitHub存储库

git推送源主机

我的最终结果是:

Roberts-MacBook-Air:wdi-fundamentals-memorygame robert$ git add -a
error: unknown switch `a'
usage: git add [<options>] [--] <pathspec>...

    -n, --dry-run         dry run
    -v, --verbose         be verbose

    -i, --interactive     interactive picking
    -p, --patch           select hunks interactively
    -e, --edit            edit current diff and apply
    -f, --force           allow adding otherwise ignored files
    -u, --update          update tracked files
    -N, --intent-to-add   record only the fact that the path will be added later
    -A, --all             add changes from all tracked and untracked files
    --ignore-removal      ignore paths removed in the working tree (same as --no-all)
    --refresh             don't add, only refresh the index
    --ignore-errors       just skip files which cannot be added because of errors
    --ignore-missing      check if - even missing - files are ignored in dry run
    --chmod <(+/-)x>      override the executable bit of the listed files

Roberts-MacBook-Air:wdi-fundamentals-memorygame robert$ git commit -m 'created game logic'
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working tree clean
Roberts-MacBook-Air:wdi-fundamentals-memorygame robert$ git push origin master
Username for 'https: //github.com ': myusername
Password for 'https: //myusername@github.com': 
remote: Permission to ga-students/wdi-fundamentals-memorygame.git  denied to myusername.
fatal: unable to access 'https://github /ga-students/wdi-fundamentals-memorygame.git/': The requested URL returned error: 403
Roberts MacBook Air:wdi基础知识记忆游戏robert$git add-a
错误:未知的开关'a'
用法:git add[][--]。。。
-n、 --试运行试运行
-v、 ——冗长
-i、 --交互式拣选
-p、 --以交互方式修补选择大块
-e、 --编辑当前差异并应用
-f、 --强制允许添加其他被忽略的文件
-u、 --更新跟踪的文件
-N、 --仅添加记录的意图—路径将在以后添加
-A、 --所有添加来自所有跟踪和未跟踪文件的更改
--忽略删除忽略在工作树中删除的路径(与--no all相同)
--刷新不添加,只刷新索引
--忽略错误只跳过由于错误而无法添加的文件
--忽略丢失检查是否在试运行中忽略文件(甚至丢失)
--chmod覆盖列出的文件的可执行位
Roberts MacBook Air:wdi基础知识记忆游戏robert$git提交-m“创建游戏逻辑”
论分行行长
您的分支比“原始/主分支”早1个提交。
(使用“git push”发布本地提交)
没什么要承诺的,正在清理树
Roberts MacBook Air:wdi基础知识记忆游戏robert$git push origin master
“https://github.com”的用户名:myusername
“https”的密码://myusername@github.com': 
远程:拒绝对myusername授予ga students/wdi-fundamentals-memorygame.git权限。
致命:无法访问'https://github /ga students/wdi fundamentals memorygame.git/':请求的URL返回错误:403

我甚至不能输入我的密码,我输入了它,没有打印出来,当我点击回车键时,我得到了上面的错误消息。我已经阅读了这个问题的答案,但我无法解决它。请帮忙,谢谢

请尝试
git-add。
而不是
git-add-a
或者运行
git-add--all
git-add-a


请记住,
git add.
只适用于
git
已经跟踪的文件

尝试
git add-A
,而不是
git add-A

也许在第一步你想要的是
git add-A
。因为你没有提交任何东西,所以在第二步你没有提交任何东西;但是你在第三步遇到的错误可能是由你的密码错误引起的。你读过git想告诉你的吗?你知道git commit-m应该做什么吗?到目前为止,你读过关于git的任何资料吗?“未知开关`a´”看起来你有一个非常旧的git版本,或者只是不兼容的git版本(可能别名为另一个comrmand?)-尝试安装一个更新的版本,例如使用自制,或者在不同的计算机上做第一个练习,直到你掌握了基本知识。你是通过XCode还是其他方式获得git的?如果是XCode,你的mac电脑有多旧,你运行的是什么版本的OS X?请在回答中添加更多说明