2013-08-19 78 views
2

我在GitHub上创建了一个名为Map的存储库。将项目上传到github C#Visual Studio

然后去我的GitHub项目文件夹,并成功克隆到该文件夹​​。它只有一个自述文件。

然后我将我的Map目录中的所有东西都复制并粘贴到我的GitHub Map目录下。

然后我做了github push -u origin master一行。

然后它说一切都是最新的,我认为这意味着没有添加任何更改,但我确实将我的项目添加到GitHub映射文件夹,因此它应该有更改?

我是否正确地处理这个问题?

我也做了我相信的所有其他命令行命令。我首先要指出为什么它可能会说“最新”,并问我是否将我的VS项目复制并粘贴到GitHub项目文件夹中以添加项目?

+0

请在将来使用适当的大写字母,即使用“我相信”而不是“我相信”。 – 2013-08-19 17:52:57

回答

2

它可能说Everything up-to-date当你github push -u origin master,因为它听起来像你还没有在你的本地回购实际提交任何提交推送到您的远程呢。

之前你把源代码到远程回购,你必须先添加并提交到本地仓库:

git add . # Add everything in the current directory (".") 
git commit 
git push origin master # Now you can push. 

此外,这是不寻常的,你会保持你的本地仓库目录从您的工作目录的独立,对于Visual Studio。典型的设置是只直接在您的工作目录初始化一个Git回购:

cd <your-visual-studio-project-folder> 
git init 
git add . # Add everything in the current directory (".") 
git commit 

git remote add origin <url-for-your-remote> 
git fetch origin 

# Rebase your local root commit onto the remote root commit 
git rebase --onto origin/master --root 

# Now you can push to your remote 
git push origin master 

最后,我强烈建议您阅读FREE online Pro Git book,特别是章1-3和6-6.5,它将帮助你解决大部分未来的Git问题。

相关问题