4

I created a git repository projecteuler-solutions and then i wanted to remove the word Euler from the file names so i renamed the files to just numbers and added the renamed files using an add command and then commited and pushed the changes , but even though in the status the file names with a euler prefix were marked as D they didn't get deleted , how can i delete those files now and what is the usual flow to rename the files ?

Bunny Rabbit
  • 8,213
  • 16
  • 66
  • 106
  • 1
    possible duplicate: http://stackoverflow.com/questions/1983346/deleting-files-using-git-github – Muhammet Emre Jul 21 '11 at 14:15
  • 1
    See this SO question and the selected answer: http://stackoverflow.com/questions/492558/git-rm-multiple-files-that-have-already-been-deleted-from-disk – Todd Moses Jul 21 '11 at 14:16

3 Answers3

1

Removal: git rm
Renaming: git mv

GreenMatt
  • 18,244
  • 7
  • 53
  • 79
  • 1
    AND, those are convenience functions to let git know in advance of the changes. It'll figure them out when you add them to the index even if you don't say this, even though the status might not look like it will. – Dan Ray Jul 21 '11 at 14:53
1

You can delete those files by using git rm:

git rm euler10.py

Normally you would use git mv to rename/move files:

git mv oldfilename newfilename
bb-generation
  • 1,487
  • 12
  • 9
1

Go ahead and rename in whatever way you are used to in your file system. Now you need to add all the changes. your rename is seen as a delete and an add.

git add -A

will be shown as a move. You can see this by running

git status

This workflow will allow you to not worry about git commands and concentrate on your work.

hope this helps.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141