Git summary

A simple and quick command to use Git installed on a company server. In this example, the Git server is accessible at https://my-git.my.company.org and the working directory is located on the development server DEV-SRV-0033.

Create a repository on Git server

Create your repository on https://my-git.my.company.org/
For example in https://my-git.my.company.org/fallout/vault-tec

Clone the directory on your work server

Connect to DEV-SRV-0033 and go to your development server and your home directory:

[lucy-macLean@DEV-SRV-0033:~]$ cd /home/lucy-macLean/

Clone the repository from Git on your development server in your home directory:

[lucy-macLean@DEV-SRV-0033:~]$ git clone https://my-git.my.company.org/fallout/vault-tec

Working

Go to your new directory:

[lucy-macLean@DEV-SRV-0033:~]$ cd /home/lucy-macLean/vault-tec/

Add or create all you need in the directory and check your work:

[lucy-macLean@DEV-SRV-0033:~/vault-tec]$ ls -lR
/home/lucy-macLean/vault-tec/:
total 20
-rw-r--r-- 1 root root 19341 Jan 31 09:35 ansible.cfg
drwxr-xr-x 2 root root 39 Jan 31 09:36 playbooks

/home/lucy-macLean/vault-tec/playbooks:
total 24
-rw-r--r-- 1 root root 23634 Jan 31 09:36 Check_Vault_033.yml

Commit your work

Add all you need to the https://my-git.my.company.org/ git repository:

[lucy-macLean@DEV-SRV-0033:~/vault-tec]$  git add ansible.cfg
[lucy-macLean@DEV-SRV-0033:~/vault-tec]$ git add playbooks/

Then commit:

[lucy-macLean@DEV-SRV-0033:~/vault-tec]$  git commit -a -m "Your_Comment"

Then push:

[lucy-macLean@DEV-SRV-0033:~/vault-tec]$  git push origin master

Documentation

Internet

🡅 Partager