Git

Основные команды GIT:

Adding an existing project to Git-server using the command line

1. Change the current working directory to your local project.
2. Initialize the local directory as a Git repository:
$ git init
3. Add the files in your new local repository. This stages them for the first commit:
$ git add .
# Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.
4. Commit the files that you've staged in your local repository:
$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
5. Copy the remote repository URL.
6. In the Command prompt, add the URL for the remote repository where your local repository will be pushed:
$ git remote add origin remote repository URL
# Sets the new remote
7. Verify the remote URL:
$ git remote -v
# Verifies the new remote URL
8. Push the changes in your local repository to GitHub / Bitbucket or other git-server:
git push origin master
# Pushes the changes in your local repository up to the remote repository you specified as the origin

Cloning an Existing Repository

When you create a repository on Git-server, it exists as a remote repository. You can clone your repository to create a local copy on your computer and sync between the two locations.

1. Change the current working directory to the location where you want the cloned directory to be made.
2. Type "git clone", and then paste the URL of you remote repository:
$ git clone remote repository URL
3. Press Enter. Your local clone will be created.



Git (произн. «гит»[7]) — распределённая система управления версиями. Проект был создан Линусом Торвальдсом для управления разработкой ядра Linux, первая версия выпущена 7 апреля 2005 года. На сегодняшний день его поддерживает Джунио Хамано.
Примерами проектов, использующих Git, являются Ядро LinuxSwiftAndroidDrupalCairoGNU Core UtilitiesMesaWineChromiumCompiz FusionFlightGearjQueryPHPNASMMediaWikiDokuWikiQt и некоторые дистрибутивы Linux (см. ниже).
Программа является свободной и выпущена под лицензией GNU GPL версии 2.

The Three States of Your Files in Git

Git has three main states that your files can reside in: committed, modified, and staged. Committed means that the data is safely stored in your local database. Modified means that you have changed the file but have not committed it to your database yet. Staged means that you have marked a modified file in its current version to go into your next commit snapshot.

This leads us to the three main sections of a Git project: the Git directory, the working tree, and the staging area.


LearnGitBranching - интерактивные уроки Git




Bitbucket («ведро битов») — веб-сервис для хостинга проектов и их совместной разработки, основанный на системе контроля версий Mercurial и Git. По назначению и предлагаемым функциям аналогичен GitHub (однако GitHub не предоставляет бесплатные «закрытые» репозитории, в отличие от Bitbucket), который поддерживает Git и Subversion[1][2].
Bitbucket поддерживает OpenID.
Слоган сервиса — Bitbucket is the Git solution for professional teams («Bitbucket — это Git-решение для профессиональных команд»).


GitHub — крупнейший[4] веб-сервис для хостинга IT-проектов и их совместной разработки. Основан на системе контроля версий Git и разработан на Ruby on Rails[5] и Erlang компанией GitHub, Inc (ранее Logical Awesome).[6]
Сервис абсолютно бесплатен для проектов с открытым исходным кодом и предоставляет им все возможности (включая SSL[7]), а для частных проектов предлагаются различные платные тарифные планы[8].
Слоган сервиса — «Social Coding» — на русский можно перевести как «Пишем код вместе». 


Комментариев нет:

Отправить комментарий