-1

Actually i am a beginner in using github. so here is my question.when i try to show commits in github i have a problem,so before adding the modification when i run git status i not only get the modifications inside the file as changes modified but also the total file as modified. for eg:

user@ubuntu:~/folder$ git status -s
 M path/to/file
 M path/to/file~

so due to this when i commit my commits show 2 changes instead of just one change but this is not the actual problem as i can solve this by giving git add path/to/file and commiting. But when i try to show changes in a macro level how i can i solve this problem???

For eg: if i edit 50 documents in my repo which already exist,how can i just add the changes in the documets and not the whole document including the changes as 2 separate changes in my commit history?

I add link to an example commit for more clarification if needed. Example Commit Click Here

Hope I have clearly explained my doubt. I would be more thankful if u clear my doubt step by step.

Subham Tripathi
  • 2,683
  • 6
  • 41
  • 70
slo-loris
  • 23
  • 6
  • i am not sure if i understood your question, do you want to add all the documents to commit in one attempt ? – Subham Tripathi Dec 24 '14 at 21:01
  • i'm confused, what are the `~` files and what do you want to do with them? it looks like those might be backups, maybe made by your text editor? do you want them to not appear in git at all? if so you can create a `.gitignore` file that contains `*~`, and then git will ignore those files entirely – Eevee Dec 24 '14 at 21:07
  • @Eevee Oh k now i understood...as u told they are backup files created by gedit...sorry for being so silly...and thanks for the reply.. – slo-loris Dec 24 '14 at 21:19

1 Answers1

0

As I guessed in the comment above: these are backup files created by your text editor, and have nothing to do with git.

You can make git ignore them entirely by creating a .gitignore file containing:

*~
Eevee
  • 47,412
  • 11
  • 95
  • 127