Add an existing local project to Git

I want to upload an existing local project to an Azure Git repo and I want it to use a .gitignore file.
What is the proper way to do this please? In the past I’ve taken shortcuts and would rather document the proper way! Ie I have a project saved locally and it should end up saved to an existing Git repo, with no unnecessary files in there.
I tried following How to upload an existing Katalon project to GitHub [other] which seems to be just the job, but it doesn’t work, since the workflow stops at the point where local folder is not empty (which it wouldn’t be - it’s the one I want to upload).

If I instead follow this: Work with Git in Katalon Studio | Katalon Docs I read that I can share the project… ok sounds good. But nothing significant happens. I now have a .git folder added to my local folder. What next? Perhaps I need to Commit my changes? Ok, I could manually add all my project files to the index, but what about my .gitignore file? That appears to be ignored? So I won’t do that because my Git repo will be full of all the files I wanted to ignore.
So, my question again is how do Katalon users add only the appropriate files (not on .gitignore list) from their local directory to a Git repo, using Katalon commands only please?

You should not ignore the .gitignore file. You should add and commit the .gitignore file into the repository. I would rather wonder why you hesitate to put the .gitignore into the repository.

When I create a new project, I always do “git init” first to make it a git-backed project. Then I create a .gitignore file. I will do “git add .gitignore”, and do git commit -m "add .gitignore". I do this at very early stage of developing the project before adding any other files.

I would recommend you to buy a good book on Git in Amazon and read its introductory chapters.

I personally always use the git command in the command line. I never use “Katalon Studio’s seamless built-in Git integration”. I don’t need the integration GUI to utilize git.

I have ever read several good books about git. All of them explain Git in the Command Line Interface like Mac’s Terminal app. Once you understand the basics of git in the CLI, you would be ready to use any GUI including Katalon as well. You would be able to interprete every operations in GUI to the git xxxx comands in the CLI. You would find nothing puzzling.

If you haven’t read any good git books and if you rely solely on Katalon’s documentation, ---- well, you are likely to get lost. Katalon’s documentation is not really a good tutorial. For example, Katalon’s doc does not cover a topic “what is .gitginore? how to deal with it”. I think that their doc implicitly assumes that the readers are experienced git users so that Katalon’s doc doesn’t need to explain the fundamentals of git.

as long as your repo .gitignore file with list of exclusions, it should work whether its a local repo or remote one

Thanks - instructions were unclear at what point to add the .gitignore but committing and pushing it first has the desired effect. I take it that what Katalon calls ‘share’ is the git init command by the way, and ‘clone’ is obviously git clone (useful for understanding the Katalon way of doing it).

suggest some good online help on git here Git - Documentation

1 Like