2

I cannot seem to find an answer or even any related material to this question via Google, stackoverflow etc.

I've recently started using Git. I created a Git repo on my local machine, and also set up a remote repo on Bitbucket. I added the Bitbucket repo as a remote on my local Git repo, and committed and pushed the contents of local repo. No probs so far, all the files and directories appeared in Bitbucket repo.

I then made some changes locally - I created a directory and moved two existing directories into it. I then committed the changes and pushed to Bitbucket.

The problem is that my Bitbucket repository, as well as correctly moving the directories into the new directory, also kept copies of them in their old location. Why is this?

Thanks

Jon Hudson
  • 1,134
  • 1
  • 10
  • 17

1 Answers1

1

Rather than a git add -u (see "What's the difference between git add . and git add -u?"), I would recommend a git mv when you want to move resources in a git repository.

See "What's the purpose of git-mv?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250