使用 Git 存储库时遇到问题
想知道是否有人可以帮助我,我在学习 Git 方面遇到了困难。
我有一个共享主机,可以在上面设置 Git。我一直在进行提交和所有事情,现在我希望能够将(错误的词汇?)我的存储库拉到我的笔记本电脑上。我该怎么做?每当我阅读这些示例时,/path/to/files 都会让我感到困惑。我的文件和 git 存储库已打开:
http://abc.com/dev/project/
我有 ssh 访问权限和一切。我的笔记本电脑上有一个本地存储库,位于:
/Users/me/Documents/project/
我想我的主要问题是:我可以复制主机上的内容,处理笔记本电脑上的文件,提交更改,然后用我的更改更新服务器吗?
Wondering if some one can help me here, I'm having a hard time learning Git.
I have shared hosting that I was able to set up Git on. I've been making commits and everything, and now I want to be able to pull(wrong vocab?) my repo down to my laptop. How do I do this? Whenever I read the examples, /path/to/files confuses me. My files and git repo are on:
http://abc.com/dev/project/
I have ssh access and everything. I have a local repository on my laptop at:
/Users/me/Documents/project/
I guess my main question is this: Can I copy down what's on my host, work on the file on my laptop, commit the changes, then update the server with my changes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这通常应该是最简单的工作流程
更新到您的评论:
这意味着远程要么是一个全新的(空)存储库(没有造成任何损害),要么它没有指定当前分支。第一件事是通过推送新分支来修复
如果本地存储库尚未从远程克隆,您可以
如果本地分支有另一个名称,您可以使用它而不是 master,或者
将当前本地 HEAD 作为新分支推送master
我建议在初始提交后重新克隆您的存储库;这样您就可以获得“传统”克隆设置(使用默认的
origin
远程和master
上的同上跟踪分支)That should normally be the most simple workflow
Update to your comment:
It means that the remote is either a completely new (empty) repository (no harm done) or that it hasn't nominated a current branch. The first thing is fixed by pushing a new branch
If the local repository hasn't been cloned from the remote, you can
If the local branch has another name you can use it instead of master, or
To push current local HEAD as the new branch master
I recommend re-cloning your repository after the initial commit is in; this way you get the 'conventional' clone setup (with default
origin
remote and ditto tracking branch onmaster
)