An issue while creating the repository file in the project using api and java

An issue while creating the repository file in the project using api and java.

While creating Repository file in Gitlab through api, with that file other file of the same project is commited at that location with the original file.

I dont understand why the other file of the same project is going to be commited in the location of the file which I am creating.

Some file are created without as they should be but some files gets the commits of the other files.
Any help would be appreciable.

Thanks in advance.