[root@ca-zdudic2 ~]# yum search "Fast Version" Loaded plugins: langpacks, ulninfo ============ N/S matched: Fast Version ============= git.x86_64 : Fast Version Control System # yum install git Installed: git.x86_64 0:1.8.3.1-6.el7_2.1 Dependency Installed: libgnome-keyring.x86_64 0:3.8.0-3.el7 perl-Error.noarch 1:0.17020-2.el7 perl-Git.noarch 0:1.8.3.1-6.el7_2.1 perl-TermReadKey.x86_64 0:2.30-20.el7 |
# cd /nagios-scripts [root@ca-zdudic2 nagios-scripts]# git init Initialized empty Git repository in /nagios-scripts/.git/ |
[root@ca-zdudic2 nagios-scripts]# ls -la /nagios-scripts/.git total 40 drwxr-xr-x 7 root root 4096 Jan 20 12:09 . drwxr-xr-x 3 root root 4096 Jan 20 12:09 .. drwxr-xr-x 2 root root 4096 Jan 20 12:09 branches -rw-r--r-- 1 root root 92 Jan 20 12:09 config -rw-r--r-- 1 root root 73 Jan 20 12:09 description -rw-r--r-- 1 root root 23 Jan 20 12:09 HEAD drwxr-xr-x 2 root root 4096 Jan 20 12:09 hooks drwxr-xr-x 2 root root 4096 Jan 20 12:09 info drwxr-xr-x 4 root root 4096 Jan 20 12:09 objects drwxr-xr-x 4 root root 4096 Jan 20 12:09 refs |
[root@ca-zdudic2 nagios-scripts]# git add . |
[root@ca-zdudic2 nagios-scripts]# file .git/index .git/index: Git index, version 2, 20 entries [root@ca-zdudic2 nagios-scripts]# strings .git/index DIRC add_build_systems.sh add_console_avocent.sh add_fcswitch-brocade.sh add_fcswitch-cisco.sh add_fcswitch-hp.sh add_fcswitch-qlogic.sh add_ibswitch-cisco.sh add_ibswitch-oracle.sh add_ovm_qe.sh add_pdu_baytech.sh RJm%p1 add_pdu_eaton.sh add_prod_systems.sh add_switch-cisco.sh add_switch-generic.sh add_switch-juniper.sh add_switch-netgear.sh add_switch-oracle.sh add_xsigo.sh add_zfs_storage.sh determine_parent.sh zG2HrCc aQWJ |
[root@ca-zdudic2 nagios-scripts]# git commit This is the first initial commit :) # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Committer: root |
[root@ca-zdudic2 nagios-scripts]# vi add_zfs_storage.sh |
[root@ca-zdudic2 nagios-scripts]# git diff diff --git a/add_zfs_storage.sh b/add_zfs_storage.sh index 87c006f..dba3a55 100644 --- a/add_zfs_storage.sh +++ b/add_zfs_storage.sh @@ -1,7 +1,7 @@ #!/bin/sh #set -x -# adding prod server to nagios -> old line +# adding zfs storage to nagios <- new line # only adds host definition # --- ERROR SUBROUTINE |
[root@ca-zdudic2 nagios-scripts]# git status # On branch master # Changes not staged for commit: # (use "git add |
[root@ca-zdudic2 nagios-scripts]# git add add_zfs_storage.sh |
[root@ca-zdudic2 nagios-scripts]# git status # On branch master # Changes to be committed: # (use "git reset HEAD |
[root@ca-zdudic2 nagios-scripts]# git diff |
[root@ca-zdudic2 nagios-scripts]# git diff --cached diff --git a/add_zfs_storage.sh b/add_zfs_storage.sh index 87c006f..dba3a55 100644 --- a/add_zfs_storage.sh +++ b/add_zfs_storage.sh @@ -1,7 +1,7 @@ #!/bin/sh #set -x -# adding prod server to nagios +# adding zfs storage to nagios # only adds host definition # --- ERROR SUBROUTINE |
[root@ca-zdudic2 nagios-scripts]# git commit [master dac65cf] Some small chage for fun ......... Committer: root |
[root@ca-zdudic2 nagios-scripts]# vi add_ovm_qe.sh [root@ca-zdudic2 nagios-scripts]# git diff diff --git a/add_ovm_qe.sh b/add_ovm_qe.sh index a83dc39..2c1224c 100755 --- a/add_ovm_qe.sh +++ b/add_ovm_qe.sh @@ -1,7 +1,7 @@ #!/bin/sh #set -x -# adding prod server to nagios +# adding OVM QE to NAGIOS # only adds host definition # --- ERROR SUBROUTINE [root@ca-zdudic2 nagios-scripts]# git commit -a [master 4476064] change prod server -> OVM QE Committer: root |
[root@ca-zdudic2 nagios-scripts]# git log commit 44760646524886dae32dd58b6c1bd54a64fc1374 Author: root |
[root@ca-zdudic2 nagios-scripts]# git show 44760646524886dae32dd58b6c1bd54a64fc1374 commit 44760646524886dae32dd58b6c1bd54a64fc1374 Author: root |
[root@ca-zdudic2 nagios-scripts]# git log --stat --summary commit 44760646524886dae32dd58b6c1bd54a64fc1374 Author: root |
[root@ca-zdudic2 nagios-scripts]# git branch * master |
[root@ca-zdudic2 nagios-scripts]# git branch testing [root@ca-zdudic2 nagios-scripts]# git branch * master testing |
[root@ca-zdudic2 nagios-scripts]# git checkout testing Switched to branch 'testing' [root@ca-zdudic2 nagios-scripts]# git branch master * testing |
[root@ca-zdudic2 nagios-scripts] vi add_build_systems.sh [root@ca-zdudic2 nagios-scripts] git commit -a [root@ca-zdudic2 nagios-scripts]# git log commit cfa44f1790d9e5518c9970934ea375894f28eb62 Author: root |
[root@ca-zdudic2 nagios-scripts]# git checkout master Switched to branch 'master' [root@ca-zdudic2 nagios-scripts]# git log commit 44760646524886dae32dd58b6c1bd54a64fc1374 Author: root |
[root@ca-zdudic2 nagios-scripts]# vi add_build_systems.sh [root@ca-zdudic2 nagios-scripts]# git commit -a [master b28497a] change prod to build-server in master branch Committer: root |
[root@ca-zdudic2 nagios-scripts]# git merge testing Auto-merging add_build_systems.sh CONFLICT (content): Merge conflict in add_build_systems.sh Automatic merge failed; fix conflicts and then commit the result. |
[root@ca-zdudic2 nagios-scripts]# git diff diff --cc add_build_systems.sh index e1d4848,372a641..0000000 --- a/add_build_systems.sh +++ b/add_build_systems.sh @@@ -1,9 -1,7 +1,13 @@@ #!/bin/sh #set -x ++<<<<<<< HEAD +# adding BUILD-SERVER to NAGIOS ... +###################################### + ++======= + # adding BUILD server to nagios ++>>>>>>> testing # only adds host definition # --- ERROR SUBROUTINE |
[root@ca-zdudic2 nagios-scripts]# git checkout testing add_build_systems.sh: needs merge error: you need to resolve your current index first |
[root@ca-zdudic2 nagios-scripts]# cat add_build_systems.sh #!/bin/sh #set -x <<<<<<< HEAD # adding BUILD-SERVER to NAGIOS ... ###################################### ======= # adding BUILD server to nagios >>>>>>> testing |
[root@ca-zdudic2 nagios-scripts]# git commit -a [master 17e1637] Merge branch 'testing' Committer: root |
[root@ca-zdudic2 nagios-scripts]# git branch -d testing Deleted branch testing (was cfa44f1). [root@ca-zdudic2 nagios-scripts]# git branch * master |
[root@ca-zdudic2 new-scripts]# git clone /nagios-scripts /new-scripts Cloning into '/new-scripts'... done. [root@ca-zdudic2 new-scripts]# vi determine_parent.sh [root@ca-zdudic2 new-scripts]# git commit -a [master c61b997] start work on brumfield gateways Committer: root |
[root@ca-zdudic2 nagios-scripts]# git pull /new-scripts/ master remote: Counting objects: 5, done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 2), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From /new-scripts * branch master -> FETCH_HEAD Updating 17e1637..c61b997 Fast-forward determine_parent.sh | 2 ++ 1 file changed, 2 insertions(+) |