View StatusGo into a git repo, and see what files are modified $ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .DS_Store modified: configs/srx100.conf
Untracked files:
(use "git add <file>..." to include in what will be committed)
deployments/switch-dmz-to-dhcp.txt other/
no changes added to commit (use "git add" and/or "git commit -a")
$
Ignore a fileThe ".DS_Store" file should be ignored because of the .gitignore file, but for this example, we can force it to be ignored $ git rm --cached .DS_Store
rm '.DS_Store'
$
Then to confirm that the file will be deleted from the git repo. (The file will not be removed in the directory, it just will be removed from the git repo.) $ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: .DS_Store
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: configs/srx100.conf
Untracked files:
(use "git add <file>..." to include in what will be committed)
deployments/switch-dmz-to-dhcp.txt other/ $
Check In (add) a fileif you have modified a file, and want to now check it in, OR if you have a new file that you want to add, you do the same thing. Use the "git add" command to add it to the commit:
Add the files $ git add deployments/switch-dmz-to-dhcp.txt
$ git add configs/srx100.conf
Confirm they were added: $ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: .DS_Store modified: configs/srx100.conf new file: deployments/switch-dmz-to-dhcp.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
other/
$
Diff a file: To see what has changed, you can use the standard unix diff-like tool to see what change has happened between the previous file that was checked in, and what the newest version is. $ git diff --cached configs/srx100.conf
diff --git a/configs/srx100.conf b/configs/srx100.conf
index d7d0f31..0f00111 100644
--- a/configs/srx100.conf
+++ b/configs/srx100.conf
@@ -1,4 +1,4 @@
-## Last commit: 2017-11-11 10:23:06 UTC by chuck
+## Last commit: 2018-08-14 22:14:02 UTC by chuck
version 11.2R4.3;
system {
host-name srx100-a;
@@ -88,7 +88,7 @@ interfaces {
description "dmz network";
vlan-id 10;
family inet {
- address 198.18.0.254/24;
+ dhcp;
}
}
unit 11 {
@@ -355,6 +355,7 @@ security {
ping;
ike;
https;
+ dhcp;
}
}
}
$
Check in the changes: To add the files to git (ie "commit the files") use the "commit" variable, and then add a comment. $ git commit -m "add - change interface to dhcp"
[master 5b73d39] add - change interface to dhcp
3 files changed, 29 insertions(+), 2 deletions(-)
delete mode 100644 .DS_Store
create mode 100644 deployments/switch-dmz-to-dhcp.txt
$
|