【发布时间】:2016-06-12 23:10:37
【问题描述】:
我在 gitlab 的 git 存储库中有一个工作应用程序。为了找出一个错误,我在一个新的应用程序目录中逐个功能地重建了应用程序。错误消失了,现在我想用新应用程序目录中的文件更新存储库中的文件。这样做的正确方法是什么?
【问题讨论】:
我在 gitlab 的 git 存储库中有一个工作应用程序。为了找出一个错误,我在一个新的应用程序目录中逐个功能地重建了应用程序。错误消失了,现在我想用新应用程序目录中的文件更新存储库中的文件。这样做的正确方法是什么?
【问题讨论】:
在你的目录中
1.新建git仓库:
git init
2.将您的远程存储库添加到上游:
git remote add origin git@.......
-你的仓库git地址
3.Checkout 远程仓库使用的分支:
git checkout -b master (or any other branch that holds your code)
4.添加并提交您的更改:
git add dir/file.py (or php or whatever)
git commit -m 'bug fixed'
4.拉取远程更改:
git pull origin master (or whatever other branch is used)
5.将您的更改推送到远程源:
git push origin master (or any other branch you checked out)
此时您的代码应该在存储库中
【讨论】:
git checkout master 时出现错误,“pathspec 'master' 与 git 已知的任何文件都不匹配。”,即使 gitlab 似乎显示当前路径已命名“主人”。