I have an existing Intellij (Ultimate 20,1 beta) project that I want to add to an existing Github repo
Within Intellij I have authenticated my account using the 'Settings/Github' option. I have setup IntelliJ as an authorized app on Github.
When I try to setup the the Github remote I am getting a 'remote: repository not found' error
Any suggestions?
As a postscript, I deleted my rep from Github and then tried using the Intellij Git/Github/Share feature to create the repo from Github.
This process created the new repo but failed with the following message
0:18 Can't finish GitHub sharing process
Successfully created project 'gd-smart' on GitHub, but initial push failed:
remote: Repository not found.
repository 'https://github.com/davoutuk/gd-smart.git/' not found
Got this working eventually via
Within Intellij I unchecked "use credential helper"
Closed Intellij
Deleted the ".git" sub directory
Deleted the 'vcs.xml' file
Made sure that I had a working Github connection under 'Settings/Github'
Then re-opened Intellij and selected the VCS for Git
Related
I have a working Spring Boot application that I created in Eclipse that I wold like to put into a new Git repository.
Unfortunately, I cannot seem to do this using Eclipse (or any other Git tool).
I am using Eclipse v2019-06 (4.12.0) and the Spring Tool Suite (STS) v4.3.1
To illustrate the problem, I take the following steps:
I create the Spring Boot project using STS:
Click on "Create a Project"->"Spring Boot"->"Spring Starter Project"
Project name is GitProject
Nothing fancy in this project. Createed a HelloController class that returned some HTML. Ran a browser to test it and displayed a "greeting" web page.
Compile project
mvnw clean package
Successful compile. Ran and successfully displayed web page:
java -jar GitProject-0.0.1-SNAPSHOT.jar
The project is successful and the service works. Place project into Git
There are procedures described to create and push to new repositories. Based on procedures provided in Stack Overflow answers, perform the following:
Create the repository
git init
Make it bare
git init --bare
Create a basic README file for adding to the repository
echo Testing > README
Add and commit the README file
git add README
git commit -m "Initial Code"
Now put the project into the repository. Or at least, attempt to...
Create a project in a different folder, importing from the new repository
Click on "Import projects..."->"Projects from Git"
Clone the URI from the new repository, Only the master branch is available. Place the destination in the project folder. Because there is no existing project in the new repo, and since the IDE does not offer a way to successfully create a new Spring Boot project from a repo (I made several attempts to use the New Project Wizard to create an STS project when creating the repo. Every attempt led to different Exceptions being thrown while creating the project), select "Import as General Project" in the "Select a Wizard" dialog.
Go to the folder with the original GitProject project. Copy everything from that folder and paste it onto the new project
Edit the .gitignore file that gets included in the Spring Boot project. It is important to remove all references to the STS files except for the .sts4-cache file. These need to be saved at least once in order to ensure that the Spring Boot information is saved in the repository.
Right- click on the project and select Team->Commit
Stage everything, enter a commit message, then click on "Commit and Push"
See the following failure:
master-master [remote rejected]
Repository
branch is currently checked out
error: refusing to update checked out branch: refs/heads/master
error: By default, updating the current branch in a non-bare repository
is denied, because it will make the index and work tree inconsistent
with what you pushed, and will require 'git reset --hard' to match
the work tree to HEAD.
You can set the 'receive.denyCurrentBranch' configuration variable
to 'ignore' or 'warn' in the remote repository to allow pushing into
its current branch; however, this is not recommended unless you
arranged to update its work tree to match what you pushed in some
other way.
To squelch this message and still keep the default behaviour, set
'receive.denyCurrentBranch' configuration variable to 'refuse'.
What is strange is that somehow this branch remains "checked out" after being cloned but the IDE does not appear to provide a way to "check it back in". Worse: I actually tried just cloning the new repo, changing the README file, then committing and pushing it (without including the Spring Boot code) and that attempt yielded the same failure.
So how do I get this code committed and pushed into my repository? What step is missing from the documentation of how to do this???
I am using Red Hat BRMS 6 to clone my remote repository project into workbench (Business central). It says cloning is successful but unable to open the project in editor.
Logs: 2018-04-02 18:47:05,793 INFO [org.kie.workbench.common.services.backend.service.KieService] (default task-14) File: pom.xml, full path [default://master#drools-bc-sync-sample/pom.xml] was not within a Project. Project Name cannot be set.
Remote Repository: https://github.com/sureshpec04/drools-bc-sync-sample
Any idea on how to resolve this error?
Update:
I am able to clone the repository now and create a project in Business central. However post-commit hook is not working. Meaning, my repository does not get updated with new files created in Business central.
post commit file:
/tools/appsw/jboss/brms/data/.niogit/drools-bc-sample.git/hooks
Contents:
!/bin/sh
git push origin master
permission is set to 777.
I'm trying to setup a Settings Repository on GitHub.
After creating a new GitHub account and a new repository if I enter the repository upstream URL in the Settings Repository dialog of PhpStorm I receive this error message:
Failed to Sync Settings: Commit on repo without HEAD currently not supported
How I can solve this?
This seems to be a bug in the Settings repository plugin of different JetBrains IDEs. A functioning workaround is to delete the local Git repository in the IDE's config directory:
${HOME}/.<IDE>/config/settingsRepository/repository
Please refer to this site for the exact directory name of your IDE on your operating system:
https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs
The workaround was posted in the JetBrains bug report (for IntelliJ IDEA):
https://youtrack.jetbrains.com/issue/IDEA-152002#comment=27-2918113
Go into "%appdata%\JetBrains\PhpStorm2020.2\settingsRepository" (change the path to match your version of PHPStorm and then rename the folder named "repository" to something else, then you can setup the project correctly. :)
I have a problem with Bitbucket and EGit. I created a new repository on BitBucket and also a new project in Eclipse. When I try to push a commit, I get the following error message:
Can't connect to any repository: https://bitbucket.org/MyName/MyProject.git
(https://bitbucket.org/MyName/MyProject.git: 401 Unauthorized)
I also tried https://MyName#bitbucket.org/MyName/MyProject.git but I got the same error. After creating the commit, I pushed by using the command line with git push and it worked without a problem. After that I tried pushing with Eclipse and EGit but I got the same error again. I checked my account name and password multiple times.
Do I need to configure EGit in some way to make it possible to push from Eclipse to BitBucket? A month ago I always pushed to a repository on a different host from Eclipse with EGit without a problem.
It depends on your version of Eclipse and Egit.
With the very latest Neon, there is a thread reporting the same issue, and a ticket opened: bug 501000.
There is a fix in progress: Change 82187: "EGit Authenticator prevents login dialog".
It is already merged into master (also on the GitHub mirror:commit 39b391c and commit 10c65c7.
Change 82539 also just got merged 3 days ago.
So Marketplace Client Project project repository 1.5.2 should include the fix.
Actually, it is called 1.5.1a, but you can use http://download.eclipse.org/mpc/releases/1.5.2. as an url.
If you are using Eclipse Neon you may also install EPP Marketplace Client from the Neon repository. Click Help > Install New Software, type "neon", select the Neon repository URL, select Collaboration > Eclipse EPP Marketplace Client and click Install.
There is also a fix in progress for EGit itself: change 82295.
I am creating a totally new OSS project for my organisation and I want to host it on GitHub. The project will be developed using Eclipse and I am using EGit. I have no prior experience with Git, as I've previously only used SVN.
Here's what I did so far:
Created a new account for my organisation on GitHub. (I already had a personal account.)
Created a new repository under my organisation's GitHub account for this project.
Under the new repository's "Collaborators" section, added my personal account. (I verified this in my personal account.)
Installed EGit into my Eclipse. (I am using Eclipse 4.2 with EGit 2.0.0)
Created a new Eclipse project in a new Eclipse workspace. (It's a Maven project so I created it through m2e but that shouldn't make a difference.)
Added the new Eclipse project to a new Git local repository (via Team -> Share Project).
Created the .gitignore (ignores Eclipse-specific files and directories).
Added source to the project (via Team -> Add to Index).
Committed local changes to my local repository.
Copied the HTTPS URL from GitHub.
Team -> Remote -> Push
The URL from the clipboard was already taken and most fields populated.
Entered username and password for my GitHub personal account, clicked Next, data was fetched successfully.
Selected "refs/head/master" from the Source ref dropdown (I didn't understand this entire page, maybe I've put something wrong?)
Clicked "Add Spec" and then Next
At this point, I got the error "master: master [rejected - non-fast-forward]"
I searched on Google, but the suggested resolution was to do a Pull. I tried "Team -> Pull", but got the error "The current branch is not configured for pull; No value for key branch.master.merge found in configuration"
Can anyone help me? My remote repo is still empty (save for the .gitignore and the README.md). I want to get files from my local into that remote repo!!
That looks like there is already committed content in your Github repository. I don't exactly know what is going wrong, but I would do it different:
First install Mylyn and the Mylyn GitHub connector in Eclipse. That way you can access github repositories much easier.
Use the Mylyn Github connector to clone your existing (assumed to be empty) Github repository into a new local repository (File->Import->Git->From Github). That is the easiest way to verify your login credentials, ssh keys and so on.
During the previous cloning step, the github repository was automatically added as "upstream" repository reference to your local repository. So if you now add files to your local repository, you can commit them and afterwards use "Push to upstream" to make them available on Github. No configuration of the remotes and refspecs is necessary in that case.
Now create your new Eclipse project and share it using the Team -> Share, where you select your existing local repository.
Everything beyond that would be as you already described.