如何在 NetBeans IDE 中设置 github 存储库?
我对 Github 很陌生。我刚刚创建了一个 github 帐户,其内容如下:
步骤 1)
Global setup:
Set up git
git config --global user.name "MyName"
git config --global user.email [email protected]
Next steps:
mkdir Java
cd Java
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin [email protected]:MyName/Java.git
git push -u origin master
Existing Git Repo?
cd existing_git_repo
git remote add origin [email protected]:MyName/Java.git
git push -u origin master
步骤 2) NetBeans IDE 尝试将链接设置为 [电子邮件受保护]:MyName/Java.git
现在它会给出错误,如您在上面看到的那样。我该如何设置这个?
跟进:(上述过程不起作用)
$ create a project > cd /var/tmp/newproject
$ sudo git remote add origin [email protected]:me/newproject.git
$ ls -a
. .. build build.xml dist .git .gitignore manifest.mf nbproject src
$ Open netbeans
> Automatically it detects
> origin:[email protected]:me/newproject.git
> press next
> local branch
> select master
> press next
> press finish
Works!
I am very new to Github. I just created one github account and it says as bellow:
Step 1)
Global setup:
Set up git
git config --global user.name "MyName"
git config --global user.email [email protected]
Next steps:
mkdir Java
cd Java
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin [email protected]:MyName/Java.git
git push -u origin master
Existing Git Repo?
cd existing_git_repo
git remote add origin [email protected]:MyName/Java.git
git push -u origin master
Step 2) NetBeans IDE trying to setup the link as [email protected]:MyName/Java.git
Now it gives error as you can see above. How do i setup this?
Follow up: (above process did not worked)
$ create a project > cd /var/tmp/newproject
$ sudo git remote add origin [email protected]:me/newproject.git
$ ls -a
. .. build build.xml dist .git .gitignore manifest.mf nbproject src
$ Open netbeans
> Automatically it detects
> origin:[email protected]:me/newproject.git
> press next
> local branch
> select master
> press next
> press finish
Works!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(6)
尝试在存储库 url 中添加 ssh:// 前缀,但我怀疑真正的原因是您尚未配置私钥(与您应该添加到 github 帐户的公钥相匹配的私钥)进行身份验证。
Try prefixing ssh:// to the repository url, but I suspect the real reason is that you have not configured the private key (the one that matches the public key which you should have added to your github account) for authentication.
您必须选择私钥,而不是公钥。
You have to select the private key, not the public one.
截至 2021 年 8 月 13 日星期五,github 更改了部分身份验证规则。这可能会弄乱 IDE。如果尚未更新,请更新已安装的 git 版本。
通过打开命令提示符、更改到存储库所在的目录(它有一个隐藏的“.git”目录)并尝试按照原始帖子的帮助中所述手动推送来测试身份验证问题:
git push - u 起源大师
。如果存在身份验证问题,您应该会看到 GUI 提示输入凭据。As of Friday the 13th in August 2021, github changed some of the authentication rules. This can foul up IDEs. Update your installed version of git if you haven't already.
Test for authentication problems by opening a command prompt, changing to the directory with your repository (it has a hidden '.git' directory), and attempting to manually push as described in the help from the original post:
git push -u origin master
. If there is an authentication issue, you should see a GUI prompting for credentials.使用 netbeans IDE 设置 Github 非常简单。按照以下步骤操作。
1 - 转到 github 并创建一个存储库,然后复制 URL,例如 https://github.com/akatkar/。 ...
2 - 打开 Netbeans IDE。如果未安装 GIT 插件,请从工具/插件安装
3 - 从 Netbeans Team 菜单中单击克隆
4 - 将您的 URL 粘贴为存储库 URL,提供您的 github 用户名和密码
5 - Netbeans IDE 将克隆您的存储库并要求创建一个新应用程序
6 - 创建应用程序并在此应用程序中复制或创建源文件
7 - 提交更改并推送到远程
8 - 完成。从 github 检查您的更改并享受...
Github setup is so easy with netbeans IDE. Follow the steps..
1 - Go github and create a repository, and copy URL like https://github.com/akatkar/....
2 - Open Netbeans IDE. If GIT plugin is not installed, install from tools/plugin
3 - From Netbeans Team menu click clone
4 - Paste your URL as repository URL, provide your github user name and password
5 - Netbeans IDE will clone your repository and will ask to create a new application
6 - Create an application and copy or create your source files in this application
7 - Commit changes and push to the remote
8 - DONE. Check from github your changes and enjoy...
对于本页中遇到类似问题的任何人,netbeans ide 的常见问题:
如果您在 github 安全设置中打开了两因素身份验证,netbeans 无法处理此问题。如果您使用 git bash cli,它将弹出一个登录框和两个因素代码输入。
另请检查 .git/ 文件夹中的配置文件,因为 netbeans 可以将 url 路径中的 git@github 更改为 [yourusername]@github.com,您可以在此配置文件中将其编辑回 [电子邮件受保护]。
这些更改应该允许您推送到远程存储库。
For anyone at this page with similar issues common problems with netbeans ide:
If you have two factor authentication switched on in your github security settings netbeans can not handle this. If you use git bash cli it will popup with a login box and two factor code entry.
Also check your config file in the .git/ folder as netbeans can change git@github to [yourusername]@github.com in the url path which you can edit in this config file back to [email protected].
These changes should allow you to push to a remote repository.
打开终端,输入项目根文件夹,然后添加遥控器:
I认为它应该检测您的设置,然后检查您的 IDE 如何设置您的 github 存储库。
Open your terminal, enter your project root fold, and add your remote:
I think it should detect your setting, then check how your IDE set your github repository.