I have a folder that I want to create a new git repository and have only specific files added to it via git add.
However, when I do git init with the following code, EVERYTHING ends up in my remote git repo.
My folder/contents already exist, and I want to just add the files/tasks/vars folders only.
I saw there was another post asking a similar question, but was using git-python commands, Id prefer to use just native "git" commands
Here is my code:
git init
git config user.email user_name@mail_server.com
git config user.name user_name
git checkout -b main
git remote add origin {{ created_gitlab_repo.project.ssh_url_to_repo }}
git add files/
git add tasks/
git add vars/
git commit -m "Initial commit"
git push -u origin main
Is there not a way to add only what I need?
The work around I guess is I just delete the folders I dont want prior to git init?