Hello - a brief introduction of myself: I’m a old coder trying to manage a git/lab project, but my git experience is limited to clone - pull - checkout - add - commit - push and rebase. that’s all I almost know.
I’ve given a mantainer role of an existing but empty gitlab repository, and have to upload a working VS proj to start versioning/tracking it vía git. This VS project contains a bunch of not-need-to-be-tracked files and folders (exists a plenty of gitignore templates) BUT such files need to exist in the repository to be downloaded at the very first clone, coz if don’t, the proj doesn’t even run (don’t know why, but it happens).
What do I need:
- any of the repository’s users be able to clone master/develop branch containing all of those needed files.
- this user create his working branch; then, the user add a gitignore file and do his work.
- when this user push the branch, changes I’ll see on gitlab to be merged should be only those “hand-touched” by the user - no single one present in gitignore.
What did I do so far:
- clone the empty master branch locally.
- copy the whole proj files to tacked directory.
- git add + commit + push (it’s how I’m filling up the gitlab’s empty project)
- checkout -b to a new branch.
- even before running VSstudio I create a gitignore file at root-project level, then:
$ git rm -r --cached + git add . + commit -m ‘Update .gitignore’
- run VS and add a //comment on an existing file.
- perform git status and yes, there’s just the hand-touched file marked as modified
(despite knowing there’re more changed files coz being runned the IDE).
- git add + commit + git push origin mybranch.
- assign to myself the merge request.
What do I see on gitlab’s changes tab:
all of the offending files present in gitignore, aside the hand-changed file and the new gitignore file are
present to be merged.
What do I expect to see:
just the hand-changed file
btw: there’s also a new gitignore file - guess I also have to exlcude it off the merge…
Am I working the right way / show I achieve my goal in a different way? which is it?
In case I’m taking an acceptable approach: am I forgetting any command?
(guess if I get my goal, every newbranch lacking of those files would be “self un-testeable” : if I checkout to that branch I won’t run coz lacking of needed files – it’s an issue…)
guess I’m understanding what’s gitlab telling to me:
what I see in the Changes tab, is the ABSENT of ignored files in myNewBranch (so gitignore is working) compared side-by-side to master, in where such files still remains (and need to continue being so).
Now I realize that I released the user of the hassle of non-wanted changes by using gitignore, but he “push the problem” up to me, coz now if I accept merge request, master branch will copy newBranch content, losing those needed files.
Should I now exclude by hand each of this files of the merge process -peventing’em of dissapearing on master? (dont’ even know if gitlab will let me do so)
Is there an easiest way to handle all of this situation?
– END EDIT
Any (detailed) help will be truly appreciate.
Thanks in advance,