BendEg
BendEg

Reputation: 21088

Mark files as changed without changing them

How to tell git that all files in a repository have changed, so I can commit and push them?

I have some component which automatically pulls git files and processes them, but only if they have changed (git status). How can I tell git that files have changed before committing and pushing them, without really changing them?

I don't want to add some spaces or some thing like that.

Upvotes: 3

Views: 7647

Answers (2)

Harish Ved
Harish Ved

Reputation: 570

If you want to acheive it anyhow, try to push 2 commits to the remote.

first, remove all files from version control, make a commit, Then add all files again to the version control, make a commit and push

You can remove a file from vc by -

git rm --cached mylogfile.log

for files and

git rm --cached -r mydirectory

for directories

Upvotes: 4

Marcus Müller
Marcus Müller

Reputation: 36337

No, that will not be possible. It's not how git works.

Your current state of work is already actually stored in git when you commit everything you've changed, so I think you're misunderstanding how git works. Adding an "empty" commit does nothing that the previous one wouldn't do.

Upvotes: 4

Related Questions