Ban Midou
Ban Midou

Reputation: 73

Git Pull not working in case of folder that was deleted?

I have pulled a branch from Bitbucket to my local. It contains multiple folders and I deleted one of the folder and commited my changes. Now, if I do a git pull, then shouldn't the deleted folder appear in my local machine again? Its not happening. Any ideas why this might be the case?

Upvotes: 0

Views: 296

Answers (2)

Aditya Singh
Aditya Singh

Reputation: 16660

It won't happen because your HEAD will be pointing to your local commit. If you want those files, then revert(reset) your local commit and then do a git pull:

  1. git log
  2. Get the hash of latest commit, which has the change for deleted files, say <Hash id 1>
  3. git reset <Hash id 1>
  4. git pull

Upvotes: 1

Noufal Ibrahim
Noufal Ibrahim

Reputation: 72795

It will not. The remote (on bitbucket) is at commit n and your own repository is at n+1 (your new commit deleting the file). If you pull, git will tell you that your branch is ahead and that there's nothing new to pull.

Upvotes: 1

Related Questions