简体   繁体   English

为什么我的文件没有被添加

[英]Why aren't my files getting added

I am trying to add two files to a local gitlab (academic clone of git hub) repo and then them push to a remote gitlab repo's master branch. 我试图将两个文件添加到本地gitlab(git hub的学术克隆)存储库中,然后将它们推到远程gitlab存储库的master分支中。

I use these commands, which run without error but don't add the file to the remote repo. 我使用这些命令,这些命令可以正常运行,但不会将文件添加到远程仓库中。

a$ git add slides1.pptx 
a$ git add slides2.pptx 
a$ git push origin master
Ubuntu 12.04.2 LTS gitlab ssh-pty

Everything up-to-date

What am I missing? 我想念什么?

You forgot to commit: 您忘记提交:

a$ git commit -m "Added 2 *.pptx files"

and only after you have committed you can push your changes to remote: 并且只有在提交后,您才能将更改推送到远程:

a$ git push origin master

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的新文件没有出现在GitHub存储库中? - Why aren't my new files appearing in my GitHub repository? git status显示一堆我从未添加过的随机文件和文件夹,它们不属于我的项目目录吗? - `git status` shows a bunch of random files and folders that I never added and aren't a part of my project directory? 从分支切换到母版时,为什么项目中的文件没有更改? - Why aren't my files in my project changing when I switch from a branch to master? 使用 IntelliJ IDEA 忽略未版本控制的文件不会添加到 .gitignore - Using IntelliJ IDEA ignoring unversioned files aren't added to .gitignore 为什么不从'.gitmodules'中删除我的子模块? - Why aren't my submodules being removed from '.gitmodules'? 为什么我的GitHub pull请求显示不属于我的提交? - Why is my GitHub pull request showing commits that aren't by me? 为什么我的Git凭证不在另一个客户端上时会被存储? - Why are my Git credentials stored when they aren't on another client? 为什么我的提交没有显示在Xcode 4中? - Why aren't my commits showing up in Xcode 4? 为什么我的 git 日志没有记录在 git 和 github 中? - Why aren't my git logs logged in git and github? 为什么我的一些文件被神奇地添加到.gitignore? - Why are some of my files being magically added to .gitignore?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM