Skip to content

Instantly share code, notes, and snippets.

@rduarte
Created June 18, 2010 16:39
Show Gist options
  • Save rduarte/443876 to your computer and use it in GitHub Desktop.
Save rduarte/443876 to your computer and use it in GitHub Desktop.
Instalando Ruby + Rubygems + Rails + Git + Fluxo básico do GIT

Este how-to é para Ubuntu e deve funcionar em qualquer distribuição Linux baseada em Debian. Para outros sistemas operacionais, help-yourself!

Instalando Ruby

$ sudo apt-get install ruby irb ri rdoc ruby1.8-dev libzlib-ruby libyaml-ruby libreadline-ruby libncurses-ruby libcurses-ruby libruby libruby-extras libfcgi-ruby1.8 build-essential libopenssl-ruby libdbm-ruby libdbi-ruby libdbd-sqlite3-ruby libsqlite3-dev libsqlite3-ruby libxml-ruby libxml2-dev

Instalando o RubyGems

$ wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
$ tar -xvzf rubygems-1.3.5.tgz
$ cd rubygems-1.3.5
$ sudo ruby setup.rb
$ sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

Instalando Rails

$ sudo gem install rails
$ sudo gem install sqlite3-ruby mongrel capistrano

Instalando Git

$ sudo apt-get install git-core git-doc curl gitk

Este how-to é para Linux e deve funcionar em qualquer distribuição. Para outros sistemas operacionais, help-yourself!

Comandos de configuração

1) Criar uma chave SSH


ssh-keygen -t rsa cat ~/.ssh/id_rsa.pub

Cole o resultado deste último comando no Account do GitHub.

2) Configurar git


git config --global github.user rduarte git config --global github.token <SEUTOKENAQUI> git config --global user.email [email protected] git config --global user.name "Ricardo Duarte"

3) Criar diretório de trabalho


mkdir xxx cd xxx

4) Instalar git no diretório


git init

5) Adicionar repositório remoto


git remote add origin [email protected]:rduarte/boep.git

6) Clonar repositório remoto


git clone [email protected]:rduarte/boep.git

Comandos de trabalho
7) Adicionar todos os arquivos ao repositório


git add .

8) Criar commit (arquivos a serem enviados)


git commit -a -m "First import"

9) Enviar branch ‘master’ para o repositório remoto


git push origin master

10) Atualizar repositório local com as alterações do repositório remoto


git pull

11) Criar branch de trabalho


git branch working

12) Alterar para o branch de trabalho


git checkout working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment