If you created new files during your development process then you need to add them to source control too. Select the file(s) and/or NOT empty directory and use
→ .
After you added the files to source control
the file appears with a added
icon overlay which means you
first have to commit (and push) your working tree to make those
files available to other developers.
Just adding a file does not affect any remote
repository!
Many Adds | |
---|---|
You can also use the Add command on folders. In that case, the add dialog will show you all unversioned files inside that versioned folder. This helps if you have many new files and need to add them all at once. |
Empty directories | |
---|---|
Git only tracks content and, thus, cannot version (empty) directories. If you
need a directory to be automatically created on checkout, make sure at least one
versioned file is in it (e.g. a placeholder file such as |
To add files from outside your working tree you can use the drag-and-drop handler:
-
select the files you want to add
-
right-drag them to the new location inside the working tree
-
release the right mouse button
-
select
→ . The files will then be copied to the working tree and added to version control.
You can also add files within a working tree simply by (left-)dragging and dropping them onto the commit dialog.
If you add a file by mistake, you can undo the addition before you commit using
→ or .You can find more information at Section G.3.2, “git-add(1)”