I am adding a new file in remote repository on master branch when i do git fetch instead of fetching new changes it deletes the file which i added
for example i added
abc.txt
in remote repository (master)
i am using git.fetch in code before pull (master)
but git fetch is deleting the file
abc.txt
here is my code
git.fetch().setRemote("origin").setRefSpecs(new RefSpec("refs/heads/master:refs/heads/master")).call();
please guide me what i am doing wrong i also looked at this answer JGit FetchCommand