已经在github.com建立了一个repository,想实现的就是,像SVN提交那样用git到github.com。安装遇到遇到很多问题
(1).git-1.9.4-preview.exe
(2).TortoiseGit
(3).github.com 官网的 git for windows
似乎是必须三个必须安装,否则就无法使用?为什么非得安装(1)git.exe?库是在远程的
还有第(3)个为什么也必须安装才可以使用?
我已经在github.com上创建了一个 repository,然后我打算将本地的 d:/website/example.com/www(这是DOCUMENT_ROOT) 作为源码目录提交过去,可是 当我当前位置是在 d:/website/example.com 这里的时候,点击克隆。之后却变成了 d:/website/example.com/example.com,然后将位置切换到 d:/website,再克隆,却一直失败,提示目录 d:/website/example.com 不是空目录。
但是我本地已经做好了,难道非得先新建一个空目录,克隆之后,再复制原先已经做好的过去?
克隆了之后,把原先做好的源码再粘贴到了目录 d:/website/example.com/www下,目录下点击右键 Git提交->master,但是却发现必须输入“日志信息”否则无法提交?如果“日志信息”这个框没有输入内容,那个“确定按钮”就始终是灰色的。
安装完tortoiseGit Git这几个软件之后,右键菜单变得非常长。
1.Git add all file 这个是用来做将文件添加.git目录中配置好的远程github.com上吗?
如果是这样,那岂不跟 他下面的“Git提交到->master”功能一样了?(点击无反应)
2.Git Commit Tool 点击后弹出提交框,但是无法提交。是提交到那里去?
1.仅仅是为了将本地的提交到远程github.com托管,
已安装了TortoisGit客户端后还必须安装git.exe吗
2.电脑Win7里面已安装了TortoisSVN,文件夹图标可以显示。
但安装后的TortoisGit文件夹图标不显示。是否是冲突?
3.右键菜单中的 这几项“Git add all file”、“Git commit tool”
功能是否跟TortoisGit 功能是重合的?
可否去掉,右键菜单太长了。
4.“Git 同步”是否就是“将本地的同步到远程”?
还是说“同步远程到本地”?点击后再点击弹出的面板上的“推送”
却需要输入Github.com的用户名,密码?
但是我使用“Git 提交->master”却不需要输入用户名密码。
一开始觉得原理应该很简单的,安装一个可以提交的客户端就可以了。但是现在却似乎不是想象的那样,弄得很晕。我使用SVN的时候安装TortoisSVN就可以用来提交了,其他什么都不需要安装。
git add ...
Put the file under git management, and it will be submitted to the local warehouse the next time you commit.The principle of git is quite simple, but it is different from SVN. If you apply the concepts of SVN to git, you will confuse yourself.
The first thing you need to understand is that the work of Git is different from that of Subversion: all operations of Subversion are directly performed on the server. Any viewing, adding files, and submissions you do directly operate the code base of the server. Using Subversion's thinking to understand Git, it can be understood that Git divides these operations into two steps. The first step is in the local code library, and the second step is in the remote code library (such as Github). These two steps are completed by different commands. (Instead of merging in one step like svn). The operations you do, except for a few commands such as clone, push, pull, fetch, ls-remote, etc., are for remote code base operations, and other operations such as viewing logs, adding files, submitting, branch management, reset, etc. are all operations. For local warehouse.
It is precisely because it is divided into local libraries and remote libraries that Git can be offline and distributed, unlike svn, which must be bound to a code base and must be online to operate.
Answer your question below:
`>1) Do all the following items have to be installed
In fact, you only need to install the git command line tool git-1.9.4-preview.exe, and nothing else is necessary
Yes, the clone operation will create a new directory. If the directory already exists, should it be overwritten or merged? If you cover it, your original stuff will be lost. If merged, this warehouse will be mixed with other things.
If you know what you are doing, you don't have to delete this directory. Use these commands in this directory to merge the remote repository into your own repository.
correspondence
git commit
命令,默认情况下提交commit必须要有comment。你可以提交一个没有comment的commit,不过得用命令行git commit --allow-empty-message
When "Git add all file" corresponds to the command
git add .
,不是添加到远程github中,而是添加到本地仓库的cache里面,之后你做git commit
, the submitted content is the files in the cache. Files that have not been added will not be included in the commit."Git commit to ->master" should not be submitted to the remote github, but only to the master branch of your local warehouse. If you don’t have a
git add
file yet, it means there are no changes to submit, and of course there will be no response. It is still recommended that you use the command line, which is the most intuitive and can clearly see any problems.TortoisGit is just a "shell" for git. All operations are ultimately completed by calling the git command line. So git must be installed. In fact, I suggest you use the command line directly, which is more straightforward and easier to understand than the GUI. Easier.
A restart may be required.
These menus should be generated by other tools? The corresponding command of Git add all file is
git add .
Git's commit is actually only submitted to the local warehouse, unlike svn, which is submitted to the server. And "synchronization" is actually a push operation, which sends the local commit that has been submitted to another warehouse. Here. You don’t need a password to commit in the local warehouse, because it is your own warehouse. You need a password to push to the remote warehouse, because it is another warehouse.
Github is so easy to use, but you understand how difficult it is to use. Many blog posts on the Internet have introduced it. How could you understand it like this? . . . svn and github are fundamentally different, don't compare them.
Git focuses on command line operations. If you install
git
on a *nix system, it will be basically OK to run the command line.There are many versions of graphics tools, and the higher the result, the more complicated it becomes.
It is recommended to familiarize yourself with the command line tools first, and then find a convenient graphical tool to use.
Someone upstairs gave a corresponding answer to your question. I would like to add some more content based on the original poster’s situation.
Finally I wish you good luck~
You only need Github for Windows
As for other instructions, you can learn about them slowly
"Sync" is just one click
Don’t use git if you don’t know how to type commands.
If you want to use it, use it well. Understand the basic data structure and commands before installation.