The project is hosted to gitHub

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/mn_kw/article/details/89923568

First, download and install Git version control tools

Download: https://git-scm.com/downloads

Registration GitHub account: https://github.com/

Why Managed to GitHub to download Git?

  is a version control system git
  github do is a version control project hosting platform with git.

 

Second, set the position of the IEDA Git as well as connecting with your GitHub account

 

 

Here we must note GitHub configuration, the account number and password to use, pay special attention to log in to your email account to use on github binding site, etc. Otherwise, the following error will occur when the share code:

Can't connect to repository from configured remote. You could want to check .gitconfig...

This error occurs, it means it is in accordance with the examination .gitconfig, as follows:

Location of .gitconfig in win10 system is: C: \ Users \ username \ .gitconfig, open text format will see:

[the User] 
name = Username 
email = E-mail

To directly modify the user name and mailbox can be on github, git can also be modified with the command:

git config --global user.name user name 
git config --global user.email mailbox

FIG example: git-cmd.exe installation directory can be found in the git

Then the IDEA git github configuration interface configuration and has a Test button, try clicking on the following, see if you can connect properly.

三、将项目托管在GitHub上

 这时用IDEA打开一个项目,然后,点击菜单栏的VCS--->Import into Versional Control --->Share Project  on GitHub,等待一会儿然后填入一些描述等待上传就可以了。

出现错误:Can't finish GitHub sharing process Successfully created project '' on GitHub, but initial push failedCould not read from remote repository.

Can't finish GitHub sharing process Successfully created project '' on GitHub, but initial push failedCould not read from remote repository.

解决办法:

在GitHub设置界面,取消勾选Clone git repositories using ssh,如下图:

四、GitHub网站项目已经删除,重新托管该项目的方法(撤销上次的托管,重新托管项目)

 可能一些误操作导致项目需要重新托管(比如上面说到的这个错:Can't connect to repository from configured remote. You could want to check .gitconfig...你直接点了yes,然后继续后面的操作就会导致托管上去的代码是一个空壳,只有名字没有代码),这就需要删除网站上的项目,然后按如下步骤操作:

1、关闭项目或IEDA;

2、到idea的工作空间找到要托管的项目,这里面有个隐藏的文件夹.git(打开windows的显示隐藏文件夹才能看到);

3、打开.git目录下的config文件,删除下图选中的部分:

只保留下面一部分代码:

只保留下面一部分代码:

[core]
  repositoryformatversion = 0
  filemode = false
  bare = false
  logallrefupdates = true
  symlinks = false
  ignorecase = true

4, reopen the project to re-Share Project on GitHub.

Guess you like

Origin blog.csdn.net/mn_kw/article/details/89923568