git - 如何将这个修改后的文件推送到github存储库

标签 git github

如何将修改后的文件推送到github

% git status
    # On branch master
    # Changed but not updated:
    #   (use "git add <file>..." to update what will be committed)
    #   (use "git checkout -- <file>..." to discard changes in working
    #   directory)
    #    modified:   login.php
    no changes added to commit (use "git add" and/or "git commit -a")

最佳答案

git status 

它将在工作树中显示所有修改过的文件和新文件

modified:   file path

未跟踪的文件:Git 不跟踪的文件

用于添加未跟踪文件

git add <file path>

添加文件后需要提交

 git commit -m "< your message>"

只提交修改后的文件

git commit -m "<your message>" <file_path 1> <file_path2>

推送代码到git

git push <origin> <branch_name>

更新远程引用以及关联的对象

有关更多详细信息,请阅读 documentation

关于git - 如何将这个修改后的文件推送到github存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35559968/

相关文章:

Github - 我切换了帐户,现在我无法推送,因为我的用户名错误

git - 推送到远程服务器同时排除一些已提交的文件?

git - 如何使用 .gitignore 忽略文件夹中的所有子文件夹

java - Git push 没有出现在 Github 中

git - 我怎样才能保持 git fork 更新?

git - 在另一个 git 仓库中维护一个 Git 仓库

git - fork 别人的 github 项目以将其作为 gem 发布的道德和礼仪是什么?

Git 每次提交和 pull 时都要求输入密码

升级到 Git 2.27 后的 git 消息 "load pubkey ... invalid format"

git - EC2 无法通过 SSH 连接到 github