cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Pull or Fetch Git doesn't work.

victorpale
Participant
0 Likes
3,027

Hello SAP's gurus

I try to synchronize my local project with my repository in GitHub.

When I try to perform Pull or Fetch, SAP Web IDE shows me the next error message: Cannot get committed changes while trying to read the field 'w1' of a null object loaded from local variable 'toFind':

What am I doing wrong?

Best regards.

Accepted Solutions (1)

Accepted Solutions (1)

rima-sirich
Product and Topic Expert
Product and Topic Expert

draymond It probably happens because you are using github.com which switched from master to main default branch. When you Initialize Local git repository, it is created with default branch master, while you are trying to fetch a git repository with default branch main. It fails simply because master branch doesn't exist in the remote repository. There are 2 ways to solve it:

1. in github.com rename main to master.

2. in Web IDE create main branch and delete master branch. if you choose this way, before creating main branch create commit with changed files

Regards,

Rima

victorpale
Participant

Rima Sirich, thank you for your comments.

You are correct (different brach's names) , when I try to do "Pull" the IDE shows me this message error:

It's try to get master branch, but doesn't. exists.

I change the name in GitHub, after do a "Pull". I can get the last commit.

Thank you so much.

Answers (4)

Answers (4)

JaySchwendemann
Active Contributor
0 Likes

Not sure if this was the right thing todo but I was just setting up the git on one of my projects and experienced the bespoke error. We have Bitbucket On-Premise and that also uses "main" as default branch name (at least in our setting).

Here's what I did to solve

  • Change the remote repository to have "master" as default branch. I was not able to do this without deleting the (empty anyway) repository that I wrongly created with default branch "main" before. There might be other ways, too, to solve this depending on your access rights or knowledge *tounge in cheek* in Bitbucket
  • Rightclick the project in Web IDE ==> Git ==> Create Remote Branch
  • Name the remote branch "master" and hit ok

This then automatically pushes the already commited changes to the remote branch

alexandru_cohal
Discoverer
0 Likes

I have the same issue, that I am able to clone from the repository, but I cannot perform any other git operation afterwards - like push, or fetch. I am getting the following error on the Web IDE console: 'Project projname: Fetch request failed. https://git.enterprise.com/team/reponame.git: 502 Bad Gateway'. Did you guys find a solution?

0 Likes

For what it's worth, I'm experiencing the same error during a fetch triggered by Set Remote on a local repository. I am able to clone the same remote repo without any error, however.

rima-sirich
Product and Topic Expert
Product and Topic Expert
0 Likes

pale Did you manage to resolve this issue? Does it happen if you clone the project again and try to fetch it?