Git: master->master [rejected - non-fast-forward]

Hello everyone!

I’m having problems understanding what is happening with my version control and if someone can share some thoughts.

We use gitlab for this purpose. So I have everything set up on the remote server, I’m the only team member that has permission to push to remote repository.
Whenever a new team member installs Katalon, or I install the latest KS version, I clone from the remote. After I’m done with what I do, I commit and push.

Other team members (or my different Katalon version) can fetch the latest changes or at least there are no error messages when doing so, but the code isn’t updated. Also, when trying to pull, I get the

master->master [rejected - non-fast-forward]

message from Katalon.

According to this SO post, there have been changes to the remote repository since my last push, but this didn’t happen.

Am I doing something wrong? Or is it a bug? Or something else?

Can I just force the pull from remote?

What do you have in your git repository — a project directory , or a Katalon Studio installed directory, or both?

Just the project directory.

The following SO issue looks similar:

How can I do

git pull web master

from Katalon Studio?

The following discussion looks very similar to your case:

I think that Non-fast-forward problem in a Git repository of a Katalon Studio project occurs due to conflicts of the <lastRun> info in *.ts (Test Suite definition) files between local branch and remote branch. The following diff message shows an example of <lastRun> confilict:

--- a/Test Suites/Main/TS1.ts+++ b/Test Suites/Main/TS1.ts@@@ -4,7 -4,7 +4,11 @@@     <name>TS1</name>     <tag></tag>     <isRerun>false</isRerun>++<<<<<<< HEAD +   <lastRun>2018-12-01T19:13:44</lastRun>++=======+    <lastRun>2018-12-01T19:03:48</lastRun>++>>>>>>> origin/develop     <mailRecipient></mailRecipient>     <numberOfRerun>0</numberOfRerun>     <pageLoadTimeout>30</pageLoadTimeout>

The best solution to this problem would be removing <lastRun> info in the *.ts file which must be included in the git repository. But this design change is up to Katalon Team.

The 2nd best is, I think, to prevent the conflicts in Git at all. But how to prevent the conflicts? There is one method — configure Git so that it ignores any changes specifically in the line of <lastRun>.*</lastRun> in *.ts files. The following Stack Overflow page tells us how to do it:

I had tried making a demo project and got success. Let me work out for writing description, wait for a few days.

1 Like

I wrote a new post:

Please have a look.

Related discussion: [Suggestion] [Katalon Studio] Last Run info could be saved in a separate fille (not in the .ts file).