Github error Dirty Working tree in katalon

Hello,

I am having issues with “pulling” the latest changes from the MAIN branch and not sure as to why! Yes GitHub confuses me and not sure what to do at the moment so I am watching videos and reading documentation. However, I wanted to see if there is anything that sticks out to you that I may need to do here.

I am able to commit but not sure why I cant pull the latest change from main branch! Is it because the other people pushed changes that are not get merged to the repo?

Here is the git history’
image

github

1 Like

it is beacuse you have uncommitted changes in ur working tree. git cannot merge two sets of changes without risking data loss . do the below @naomy.arnold

1- commit ur changes and then pull or

2- stash ur changes and then pull (git stash and then git pull and then git pop) or

3-discard ur changes and then pull

2 Likes

HI are you doing this via command line? If so How can I do this as i just started using Katalon and still trying to get better at GIT.

I dont see stash on Katalon Github options in the history.

It is always easy and convenient to do via command line. if you have it , just do the below. Unfortunately , stash is not available on KS GIT UI and hence you cannot do it via that but you can do it via calling the below command in your test script

1- git stash (it will save your changes)
2- git pull (all ur changes would be pulled)
3- git pop (back to the changes that were saved in #1)

or in katalon studio in ur test script : try the below

WebUI.executeJavaScript(‘git stash’)

you need to call the above stash command in every test case though if using KS script. If you have 2 changes , then call the above command in both the changes

2 Likes

Are you doing this through Katalon build CMD in katalon or you download gitbash then clone repo then run these commands?

if you have git bash , use the below

1- git stash (it will save your changes)
2- git pull (all ur changes would be pulled)
3- git pop (back to the changes that were saved in #1)

if you want it in Katalon Studio , use the below command in katalon studio test case script

WebUI.executeJavaScript(‘git stash’)

Note : - you need to call the above stash command in every test case though if using KS script. If you have 2 changes , then call the above command in both the changes

3 Likes

Yes , clone the repo and then use the commands but ensure that you are on your branch

1 Like

I am going to download gitbash then clone the repo and try these commands, I will get back to you. Thanks for taking the time out to assist me
@monty.bagati

1 Like

Ok You are right Katalon was not too good with GIT and limited, hence I ended up using GITHUB for desktop and got some help!

I will try to do everything from VScode since GITHUB desktop is also limited with fixing conflicts. With VScode I have GIT and the terminal there to use commands to push , pull, stash etc…

2 Likes

Yeah , using git terminals would be much easy for events like stash , merge etc.

2 Likes

I added @monty_bogati comment as a solution because using the terminal prevents any git issues or lets you see issues better then using Katalon! @Eve_2024 We should have a better experience if it has GIT integrations. You should think about making it easier not more work. Respectfully there should be no integration if we still have to use the command line if this makes sense.

1 Like

my personal advice.
Never use git integration like features with any IDE or IDE like tool.
No matter if Katalon or any other products.
I never did. Will never do.
I use plenty such tools, but i allways disabled such ‘integrations’ and for git i used just native git clients.
terminal mostly

reason?
git api is pretty complicated.
there is no way for a certain IDE to implement each and every magik under the hood for ‘clickhere’ and keep it robust

katalon is not to be shamed here.
simply, git is not for mortal users.
learn the terminal options and your life may be better.

1 Like

I agree Katalon is NOT to be shamed, I like their platform. thank you for your advice. I been using the terminal now and NO issues. YOU ROCK.

If all else fails, I just save my files from the project with issues, and do a re-clone. Its like pressing the reset button.