Skip to content

Commit ef606a6

Browse files
authored
Added explanation of git add options.
1 parent cc6fc0e commit ef606a6

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

0 General/11 Git Lab Workflow.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
`git status`
2727

2828
1. Use whichever or these four options is appropriate to add the necessary files to git tracking:
29-
`git add .`
30-
`git add <filepath>`
31-
`git add <directorypath>`
32-
`git add -A`
29+
`git add .` # Add file changes in current directory and below to staging.
30+
`git add <filepath>` # Add a specific filepath to staging.
31+
`git add <directorypath>` # Add a specific directory path to staging.
32+
`git add -A` # Add all file changes in whole repository to staging.
3333

3434
1. Use `git status` to view what files and directories will be added to the commit:
3535
`git status`
@@ -71,7 +71,11 @@
7171
## Switch between in-progress branches.
7272

7373
1. Git `add` and `commit` changes to current branch:
74-
1. `git add -A`
74+
1. Use whichever `git add` option as appropriate:
75+
* `git add .`
76+
* `git add <filepath>`
77+
* `git add <directorypath>`
78+
* `git add -A`
7579
1. `git commit -m <commit message>`
7680

7781
1. Checkout the different branch we want to work on:
@@ -80,7 +84,11 @@
8084
1. Do the code changes for this branch.
8185

8286
1. Git `add` and `commit` changes to the new current branch `<a-branch-name>`:
83-
1. `git add -A`
87+
1. Use whichever `git add` option as appropriate:
88+
* `git add .`
89+
* `git add <filepath>`
90+
* `git add <directorypath>`
91+
* `git add -A`
8492
1. `git commit -m <commit message>`
8593

8694
1. Checkout some other branch we want to work on:

0 commit comments

Comments
 (0)