Can't switch to other branch from Master

I have this problem with several Git repositories. It doesn’t matter which tooling i use. (Gitlab, Github, Bitbucket) that when i clone a Git repository i cannot switch branches.

Example:
I have a REF project and added it to git. At that point i have a Master branch. I create a develop branch from the master branch.
So 2 branches at this point. I only want to work with the develop branch and only merge to master when i have a new release.

When i open uipath studio it always opens the master branch. Ok, no problem i should say. When i want to switch to the other branch the problem starts. I get a message that i should commit my changes first. I have not made any changes to the project, because i just opened it. So i can’t undo them.
from-master-switch-to-develop5
Trying to switch branch:
from-master-switch-to-develop
Message:
from-master-switch-to-develop2
I cannot undo changes, because i didn’t made them. And i don’t want to commit to the master branch.


The branches i have present

So at this point the whole git project cannot be changed in Uipath Studio and i am forced to work on the master branch, which actually is not an option.

I do not always have this problem when i work alone on a project. I have it most (if not all) the time when working in a team on a project.
A colleague has an older or newer activity present. When i open the project, the dependencies will be checked and it can cause that the cache or project.json gets edited. In this case it is even the Main.xaml. At that point the master branch is out of sync and i cannot switch to the develop branch anymore. At that point the repository becomes useless for me. It causes me to have to switch back to a Gitclient (sourcetree) to be able to switch branches again (and after that open the project when the correct branch is selected

If anyone else is having this issue/problem please let me know if you have any solution for this. An ignore file isn’t a real solution, because i also have this problem on the Main.xaml

I like the Git functionality, but at this point it is too buggy and unreliable which forces me to stay working with SourceTree or another Git client.

2 Likes

Can you try with git bash to see what is the change made?

I will see if i can collect some data on that. Because at home im on community edition. At work i am on the enterprise studio.
The main problem is that i would like to select the branch i want to work on BEFORE the project files are opened in Studio. We never work in the master branch.

With a client you clone the repo, checkout the branch and then open those files.

1 Like

Hi

Were you able to find a solution on this ?

Hi @vishnuvarthanp
No solution yet. I still have this problem. I can’t swith in Uipath from one branch to the other. So i still use a gitclient to swith to the preferred branch and then open the project in UiPath. I have more issues with local branches and remote branches (you can delete a remote branch, but it will still be visable in Uipath).

So at this point i don’t use the Git functionality in Uipath studio. It is too buggy for me

Hi,
I just started working with GIT in UiPath Studio, and have the same issue. I can’t switch branches because some files get updated while being copied to my machine. Here is the error message:

image

When I try to undo those changes, UiPath Studio crashes:

image

Is there any solution to this problem so far? Or will I have to checkout a needed branch in GIT bash first and then open it in Studio? This is really unfortunate, as I really would like to have all functionality in one place.

Haven’t used git features of UiPath much. Try this.
Add .local to .gitignore file.

Hi @KannanSuresh, thanks for your suggestion. Where can I find that file?

Another question is - how important is .locals folder? Does it impact bot functionality in any way?

.gitignore is a file that you create in the git folder to exclude certain files or folders from version control. The file should be placed in the root folder of the git repository.

You can read more about .gitignore from the link below.

As far as I understand the .local folder contents get auto generated when you open the process using UiPath. So, I believe it should be ok to ignore files in .local folder from version control. You could test this by creating a copy of your project locally and then delete the .local folder and see if it still works. Note: .local folder is hidden by default, so you must make hidden folders visible to see it.

Hello from the future! We still have this problem in 2024 when opening old projects with a newer version of Studio. Studio likes to open a project and then immediately alter files to suit its new schema without asking for user permission. Fortunately, someone in my future saw this post and opened a wormhole to my present in order to share a possible workaround. Here it is:

  • Install GIT Tools if you have not already done so
  • Launch Studio and open your project. Make a note of which branch is open and impossible to navigate away from due to uncommitted changes
  • Launch GIT Gui
  • Open your repository in GIT Gui (i.e., navigate to your local copy of the project folder)
  • Ensure the same branch is open in GIT Gui that is open in Studio
  • From the menu bar, click Branch > Reset
  • Return to Studio and try to change branches. It should work now and you can stop here.
  • If you are still unable to change branches, you may need to “commit” your changes first. Click on the button to commit. Studio will notify you that there are no changes to commit. Then close the dialog and attempt to change branches again.
  • Take heed, you will also lose any intentional updates you may have made since the last commit; prudent users will make a copy of their local folder before trying the steps above.

If the above steps do not work, you could try to open your own wormhole back to a point in time before Studio made its automatic changes.** Be warned, however, as there is a chance that the ensuing causal paradox may open a devastating temporal rift in the fabric of spacetime and bring about the end of the universe. On the other hand, perhaps UiPath then would take note and update Studio so that it takes the simple and obvious precaution of asking users whether they would like to change branches before it automatically changes the files.

** There exists a truly marvelous method for this, which this margin is too narrow to contain.