Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将本地主机web目录传输到github存储库_Git_Repository_Push_Pull - Fatal编程技术网

将本地主机web目录传输到github存储库

将本地主机web目录传输到github存储库,git,repository,push,pull,Git,Repository,Push,Pull,我在github.com上创建了一个帐户,我对git非常陌生。我有ubuntu,在htdocs中有一个web文件夹。我希望能够提交任何更改并显示在我创建的github存储库中。当我尝试 git commit {github url} 它不会出现在github网站上。我知道我首先需要将文件夹推送到git,但当我尝试推送时,什么也没有发生 我按照一些教程在我的计算机上设置git,我认为它在创建.git文件夹后就起作用了 欢迎提供任何帮助或链接到一个好的git/github配置教程。假设您已经在

我在github.com上创建了一个帐户,我对git非常陌生。我有ubuntu,在htdocs中有一个web文件夹。我希望能够提交任何更改并显示在我创建的github存储库中。当我尝试

 git commit {github url} 
它不会出现在github网站上。我知道我首先需要将文件夹推送到git,但当我尝试推送时,什么也没有发生

我按照一些教程在我的计算机上设置git,我认为它在创建.git文件夹后就起作用了


欢迎提供任何帮助或链接到一个好的git/github配置教程。

假设您已经在github上创建了一个空存储库,您需要使用
git push origin
在将github添加为
origin
后将提交推送到github:

git add origin https://github.com/user/repo.git
您还可以通过以下方式检查您的
遥控器
s:

git remote -v

更多信息供参考:

提交时没有URL的概念,它是一个本地操作。提交更改,然后将其推送到Github存储库

有关开始使用新Github存储库的所有信息,请参见: