是否有任何可用的测试 GIT 存储库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4548784/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 04:52:08  来源:igfitidea点击:

Is there any test GIT repository available?

git

提问by SunnyShah

I want to learn git, so is there any online test git repository available, Just for test? so that I can learn how to work with remote GIT repos?

我想学git,请问有没有在线测试git仓库,仅供测试使用?以便我可以学习如何使用远程 GIT 存储库?

回答by siride

Git isn't like SVN in that you don't need a central repo. What you can do is take a directory full of files and make a copy. In the copy, run "git init" and voila, you have a git repo to play with. You can even clone from it locally and practice pushing and pulling. You can do this all without even being connected to the internet.

Git 与 SVN 不同,因为您不需要中央存储库。您可以做的是获取一个充满文件的目录并进行复制。在副本中,运行“git init”,瞧,你有一个 git repo 可以玩。您甚至可以在本地克隆它并练习推拉。您甚至可以在没有连接到互联网的情况下完成这一切。

回答by aeter

You can clone any repo you like at github.com. If you need more functionality (merging, pushing, etc.), you can create your own testing repo there (currently this is free) - http://help.github.com/creating-a-repo/

您可以在 github.com 上克隆您喜欢的任何存储库。如果您需要更多功能(合并、推送等),您可以在那里创建自己的测试存储库(目前这是免费的)- http://help.github.com/creating-a-repo/

回答by wenzeslaus

Well, this is older question but it can be still very current for others.

嗯,这是一个较旧的问题,但对其他人来说仍然是最新的。

I usually use the following work flow (it is more or less what siride answer is suggesting). It is usable for testing Git or for having the remote repository at network drive or service such as Dropbox (instead of github.com or others).

我通常使用以下工作流程(这或多或少是siride answer 所建议的)。它可用于测试 Git 或在网络驱动器或服务(例如 Dropbox(而不是 github.com 或其他)上)拥有远程存储库。

Create a directory which will act as a remote repository:

创建一个目录作为远程存储库:

cd /somewhere/on/hard/drive/eg/Dropbox
mkdir my_project
cd my_project
git init --bare

Go to the existing project directory (or create if you don't have any):

转到现有的项目目录(如果没有,则创建):

cd project_dir
git init
# add all files you want to add, e.g. *, *.cpp *.h, '*.cpp' etc. or one by one
# create some file if you don't have any
git add *
git commit -am "initial commit"

Still in the project directory, connect to the remote repository:

仍然在项目目录下,连接远程仓库:

# add the remote repository
git remote add origin /somewhere/on/hard/drive/eg/Dropbox
# push for the first time
git push -u origin master

Then you can git commit, git push, git pullor whatever you want try. To create a new clone of that repository use standard clone:

然后你可以git commit, git push,git pull或者任何你想尝试的东西。要创建该存储库的新克隆,请使用标准克隆:

git clone /somewhere/on/hard/drive/eg/Dropbox my_project_dir

This works great for testing because it does not require any sever or third party service and it is usable even for the real work.

这对测试非常有用,因为它不需要任何服务器或第三方服务,甚至可以用于实际工作。

Alternatively, for complete beginners, http://try.github.io/which allows you to try basic Git commands in your web browser.

或者,对于完全的初学者,http://try.github.io/允许您在 Web 浏览器中尝试基本的 Git 命令。

回答by ssuperczynski

And here is the repo where you can test do the pull requesthttps://github.com/octocat/Spoon-Knife

这是您可以测试的pull request仓库 https://github.com/octocat/Spoon-Knife