0

This is simple recipe for copy git repository.

git "/home/testuser"  do
repository git_repo
revision 'master'
action :sync
end

git_repo is a variable which has path of git repository.

This works fine when run first time. But if my repository is already sync and if some file changed or delete in local copied repository folder then by run this git resource will not update local repository and say up to date even some files deleted in local repository.

Why this is happening even some files are not in local copied repository ?

Vikas Saini
  • 1,124
  • 3
  • 11
  • 24

1 Answers1

0

What it checks for idempotence is if the deploy tracking pointer matches the same commit SHA as the remote gives for the requested branch. So if either you change the local sha by doing a commit or (more common) the remote has new commits, it will sync. It doesn't automatically run things like git clean -fdx because of the usual use case of running some kind of application or service from a git clone of its code, in which case that would be Very Very Bad™. You could easily add that as an execute resource if it's something you need though.

coderanger
  • 52,400
  • 4
  • 52
  • 75