Git

From INIwiki
Jump to: navigation, search

General GIT Commands

Contents

[edit] SSH

If you want passwordless ssh you need to add the global key to the /root/.ssh/ folder

[edit] SETUP user and email

git config --global user.name "%HOSTNAME%" git config --global user.email YOURNAME@DOMAIN.com


[edit] If repo already exists

[edit] First Checkout

Make sure folder with same name as repo does not exist or is empty

cd to one level up and run these commands.

For example if we want to checkout the repo called FILES to the / of the server

cd /
git clone gituser@git.repo.com:/FILES.git

This will create /FILES on the local server with the /FILES repo content now locally

To add new files

git add .

Commit changes with comment

git commit -am "Added new folder"

Push update to git repo

git push origin

[edit] If repo does NOT exists

You have content locally that needs to be added to GIT protection.

Personal tools