fix(git): reset hard on remote branch before pulling
This commit is contained in:
parent
b8be697e60
commit
3959fd8a1f
1 changed files with 5 additions and 1 deletions
|
@ -88,8 +88,12 @@ export class RepoExecutors {
|
|||
this.logger.info(`stdout: ${stdout}`);
|
||||
});
|
||||
|
||||
const currentBranch = await execAsync(`git -C ${repoPath} rev-parse --abbrev-ref HEAD`).then(({ stdout }) => {
|
||||
return stdout.trim();
|
||||
});
|
||||
|
||||
// reset hard
|
||||
await execAsync(`git -C ${repoPath} reset --hard`).then(({ stdout, stderr }) => {
|
||||
await execAsync(`git fetch origin && git -C ${repoPath} reset --hard origin/${currentBranch}`).then(({ stdout, stderr }) => {
|
||||
this.logger.info(`------------------ git -C ${repoPath} reset --hard ------------------`);
|
||||
this.logger.error(`stderr: ${stderr}`);
|
||||
this.logger.info(`stdout: ${stdout}`);
|
||||
|
|
Loading…
Reference in a new issue