检查后,我如何上传我的项目的Git存储库到GitHub?,我仍然不知道如何让一个项目上传到我的GitHub存储库。

我创建了一个存储库,并想将我的项目上传到它。

我在存储库页面上查看了某种上传按钮,但我没有看到任何类似的东西。

到目前为止,我已经查看了提供的链接,但仍然一无所获。他们提到了命令行;是Windows命令行还是Git Bash?因为我不能让他们做任何事。

我也尝试使用Git GUI,但是当我选择我想要的文件夹时,它说它不是Git存储库…需要拉上拉链吗?我尝试在文件夹中添加.gitconfig文件,但没有什么不同。


当前回答

使用Git的最佳方式是实际启动giting。试试这个网站,它会让你一步一步地了解在命令行上执行功能的基本方法,以便在GitHub上推送项目。

这个叫做try.github.io,或者你也可以参加Codecademy的课程。

其他回答

Open Git Bash. Change the current working directory to your local project. Initialize the local directory as a Git repository: $ git init Add the files in your new local repository. This stages them for the first commit: $ git add . Commit the files that you've staged in your local repository: $ git commit -m "First commit" At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL. In the Command prompt, add the URL for the remote repository where your local repository will be pushed : $ git remote add origin remote repository URL Push the changes in your local repository to GitHub: $ git push origin master

按照以下步骤将项目上传到GitHub:

git init Git添加。 添加我所有的文件 Git远程添加origin https://github.com/yourusername/your-repo-name.git

上传的项目从零开始需要git拉源码master。

Git拉源主 Git push origin master

如果在推送过程中出现任何问题,请使用git push——force origin master。

我认为最简单的方法就是为Eclipse安装Git插件。它的工作原理或多或少与Eclipse CVS和SVN插件相同。

We need Git Bash In the Git Bash Command Section: ls It will show your default location. CD "C:\Users\user\Desktop\HTML" We need to assign the project path. git init It will initialize the empty Git repository in C:\Users\user\Desktop\HTML ls It will list all file names. git remote add origin https://github.com/repository/test.git It is your https://github.com/repository/test.git is your repository path git remote -v To check whether we have fetch or push permission or not git add . If you use . then it means whatever we have in the particular folder publish all. git commit -m "First time" git push -u origin master

遵循RishiKesh Pathak的指示。你甚至可以通过只插入一次这个命令行来缩短push命令:

git config --global push.default simple

所以下次不要使用git push origin master,你只需要:

git push

详情请点击这里。