【问题标题】:Why is my package.json file not showing on Github after telling me it has been updated?为什么我的 package.json 文件在告诉我它已更新后没有显示在 Github 上?
【发布时间】:2021-06-30 09:25:12
【问题描述】:
git add .
The file will have its original line endings in your working directory   
warning: LF will be replaced by CRLF in package.json. 
PS C:\Users\HP\OneDrive\Desktop\gg> git push origin main  
Everything up-to-date
PS C:\Users\HP\OneDrive\Desktop\gg> git pull origin main  
From https://github.com/Osomhe1/sass
 * branch            main       -> FETCH_HEAD
Already up to date.

但是 package.json 没有显示。

【问题讨论】:

标签: git github package.json


【解决方案1】:

通常pushing(uploading)本地文件到github的工作流程如下:-

  1. git add . -> 此命令将所有文件添加到暂存区。
  2. git commit -m " your commit message" -> 这就像拍摄更改的快照以将其保存在提交历史记录中。
  3. git push origin master -> 该命令将本地 master 分支推送到 origin,origin 是 github 中仓库的远程 URL。

不时运行git status 是一个很好的做法,它会告诉您哪些更改需要暂存或提交。

注意:- 请检查您是否设置了上游,这意味着您已经设置了远程存储库的来源。 检查git remote -v -> 这将显示您的远程存储库的 URL 以及获取和推送。

如果不是那么git remote add URL-of-the-repostiroy

【讨论】:

    【解决方案2】:

    git 提交

    然后

    git 推送

    那么它应该在你的仓库中。

    【讨论】:

      猜你喜欢
      • 2021-04-23
      • 2020-12-31
      • 2016-08-13
      • 2020-12-25
      • 2021-12-22
      • 2022-06-16
      • 2018-03-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多