I have a local git repo that I cloned by using
git clone --depth 1 my_repo_url
so that I only have the latest commit and don't have to worry about keeping a large history around.
If I now do a git pull, I may now receive, let's say, two more commits from the remote repo. What I want to do is update my repo to again only maintain the latest commit and NOT the rest of the history. However, I do NOT want to use squashing/rebasing, since this will actually change my local history and result in conflicts when I try to pull again from the remote server.
Basically, if I have a commit history of:
commit1 --> commit2 --> commit3 --> commit4
I want to maintain only a snapshot of the repo at point commit4.
But I do not want to squash all these commits, because then I will be left with commit4* which will have a different hash from the original commit4, and hence will cause conflicts when I try to pull from origin again.
I also do not want to use git clone again, since this will not take advantage of the fact that I may only have to send a small diff over the network, if something very small changed in the latest commit on the remote server.