1

I am a very Junior engineer. I'm trying to push a new project to GitHub. I created a GitHub account and a repository named TeamBuilder. When I try to push the project to GitHub via Git/IntelliJ, I get the following error:

enter image description here

So, when I try to do a pull/merge or a pull/branch default, I get this error:

enter image description here

I've read through a few SO posts, including this one and this one, but I'm not sure I understand the command lines, even after reading about them in the Git help documentation.

When I try to set the upstream branch to master, I get this error:

Warning: Not setting branch master as its own upstream.

How can I successfully push this project to my GitHub repo? I'd like some help on this before I continue down the rabbit hole and break something.

1 Answers1

1

Update project action in IntelliJ wants the current branch to have a configured tracked remote counterpart and fails if there is no such. So to make it work you can set a tracking from the command line with git branch --set-upstream-to origin/master command.

Note origin/master, not a simple master - this should be a reference to a remote branch. Using such reference is only possible when there is a remote defined in git-config. IntelliJ can help with setting remotes, check VCS - Git - Remotes...

As a side note, you can use the Share on GitHub action in IntelliJ to push new projects to GitHub - the action will automatically create a new repo and push the code.

Dmitrii Smirnov
  • 7,073
  • 1
  • 19
  • 29