Skip to content

Commit

Permalink
Add section "Explicitly add files"
Browse files Browse the repository at this point in the history
  • Loading branch information
jvgeiger committed Oct 2, 2023
1 parent 86196d6 commit 34e09ce
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/working_with_github/working_with_github.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
:lisf: LISF
:lisf_git: LISF.git
:lisf_test_git: lisf-test.git
:emdash: —


== General notes
Expand Down Expand Up @@ -947,7 +948,7 @@ Yes, you may have two sets of commits and two sets of pull requests for your wor
[WARNING]
====
In general, do not run `git add --all`; this always ends up adding files to your commit that do not belong. And, in particular, do not run `git add --all` when working with private/restricted repositories. If you accidentally do, then you will see the following warning. Follow the hint for running `git rm`.
In general, do not run `git add --all`; this always ends up adding files to your commit that do not belong. (See Section <<Explicitly add files>>.) And, in particular, do not run `git add --all` when working with private/restricted repositories. If you accidentally do, then you will see the following warning. Follow the hint for running `git rm`.
.Accidental `git add --all`
....
Expand All @@ -972,6 +973,19 @@ add 'RESTRICTED/restricted-ua-lsm/'
====


== Explicitly add files

Do not run commands like `git add .` or `git add --all`. These commands will add files to your commit that do not belong. For example, you may end up adding restricted code, backup files, temporary build scripts, and executables {emdash} files that do not belong in the repository.

Add files to a commit explicitly. For example, you added a new output variable to NoahMP 4.0.1:

....
% git add core/LIS_histDataMod.F90 surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90
....

See `git help add` for more information about adding files to a commit.


== Useful commands

....
Expand Down

0 comments on commit 34e09ce

Please sign in to comment.