Git

From SHellium Wiki
Jump to: navigation, search
Geographylogo.png In other languages: English | Afrikaans | Albanian | Arabic | Brazilian | Bulgarian | Catalan | Chinese | Croatian | Czech | Danish | Dutch | Esperanto | Estonian | Filipino | Finnish | Flemish | French | German | Greek | Hebrew | Hindi | Hungarian | Indonesian | Italian | Japanese | Latvian | Lithuanian | Macedonian | Malay | Malayalam | Norwegian (Bokmål) | Norwegian (Nynorsk) | Persian | Polish | Portuguese | Romanian | Russian | Serbian | Slovak | Slovenian | Spanish | Swedish | Turkish | Ukrainian | Urdu

Using Git

Git is a distributed version control system, which means it does not have to have a central server to connect to to store the repository. As such, it is a lot easier to create a git repository than it is to create a traditional source control repository (such as cvs or svn).

To create an empty git repository in the current directory:

git init

To add files (new or modified) to the list of files to be committed to git:

git add

To write changes to the git repository:

git commit 

To create a git repository on a server (to share with others, or as a backup):

git clone --bare localrepository remoterepositoryname.git
scp -r remoterepositoryname.git user@host:remoterepositoryname.git

To push a git repository to a server (update the remote repository):

git push ssh://user@host/~user/path/to/repository

To update a local repository from a server:

git pull ssh://user@host/~user/path/to/repository

To clone (download a copy) a git repository:

git clone ssh://user@host/~user/path/to/repository

For additional help:

git help

Neat tricks

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Indexes
SHellium Sites
Toolbox