0

I use git from command line to backup one of my folders.

The problem is, sometimes I forget to do that for a few months and it becomes impossible to know which are new files, which are moved etc. I know I'm supposed to use git mv, git add etc. But in practice, I work in these folders very rapidly and don't have time to think about git all the time.

Is there any way for git to automatically sync this? Without doing a git add ./*? I know some software does this, e.g. eclipse, but my folder contains many separate latex projects, impossible to have a texmaker or something sync this info.

I was hoping here is a git command to find and automatically add new files/ delete removed files.

Apologies I realise this is not correct usage of git, but it is the situation I am faced with...

dorien
  • 5,265
  • 10
  • 57
  • 116

1 Answers1

2

use git add -A, that adds all files to the staging area.

  • Thank you. Does this also remove files that have been deleted from the repository? – dorien Aug 26 '17 at 05:55
  • Yes that adds all changes to staging. –  Aug 26 '17 at 05:55
  • Excellent, I'll try as soon as I get to my computer – dorien Aug 26 '17 at 05:57
  • It does as long as your Git is at least 2.0; in older Gits it worked from current directory downwards only (sometimes what you mean, sometimes not; if you want that, use `git add -A .` or `git add --all .`). – torek Aug 26 '17 at 16:14