How t change the pull command to overwrite the files, without shifting and removing the files on my own?

449    Asked by ChrisEVANS in Devops , Asked on Jul 25, 2023

I had few files in .gitignore on my branch. On another branch, those files are missing. I wish to merge the other branch into my branch, and I do not care whether the files are ignored ot not. However, I am receiving the error : the following untracked working tree files would be overwritten by merge like below: The following intracked working tree files would be overwritten by merge How to change the pull command to overwrite the files, without shifting and erasing the files on my own?


Answered by Asistha pandey

The error mentioning that the following untracked working tree files would be overwritten by merge is invoked while attempting to pull a remote branch when working on a local branch. The projects can be similar, however the local branch requires to be capable of tracking the remote for it to pull properly. The cause of receiving the error lies in the fact that you are not recording the files locally. However, there can be an opportunity that the similar files are recorded by the remote branch . Hence the pull is pressurizing the system to overwrite those files that are not controlled by version. To deal with this you can utilize:

Git add *
Git stash
Git pull

These commands will record all the files and erase the modifications in files available on the local system. And finally receive the files from the server. The devops certification training offers an online experience alike offline classes and relieves you from the hassle of taking lessons from a physical location. The company provides a total devOps discipline preparation by covering all the fundamental and advanced concepts.


Your Answer

Interviews

Parent Categories