简体   繁体   中英

Does Using 'git push -f' On A Remote Repo Refresh The Entire Folder?

I have a GIT repo for an application. The application starts a long running process that I want to keep running in the background.

When I make a change to any of the application config files, commit those changes, and then git-push those changes, everything works fine. The long running process picks up the config changes I've pushed.

Sometimes though, I make a mistake in the commit history and purge those commits with a rebase. I then use git push -f to force the purged changes through. Doing so kills the long running process.

Why would that be?

As I understand it, when I git-push commits, it will only change the lines of code that I have edited.

Am I right in thinking that using git push -f instead changes more than just the lines in the commits I've purged? I suspect the git push -f command is also refreshing (though not changing) other application files in the repo, if not all of them, and that's why the process dies on a rollback attempt...

Does anyone have a definitive answer?

Though I still have my suspicions, I think the issue may have just been caused by a careless commit that overwrites the file that the process is based on.

If I discover anything new (as likely as that might be), then I will update the answer. Thanks for the help.

Update :

I'm pretty sure that it's not GIT now. It was because the long running process prints out messages to the terminal. When I was testing the GIT hook, I always had an SSH terminal open, so the program ran fine. But when I closed the terminal and made an upstream push from my remote machine, the application had no terminal to print messages to...

Doh.

Accounting for this appears to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM