Github

Rômulo Machado


                 42
Conteúdo

●
    O que é Git? O que é Github?

●
    “Being Social”

●
    Configurando o Git

●
    Administrando repositórios

                                   42
Você sabe pra que serve
       o github?




                          42
Você sabe pra que serve
          o github?




Vamo ver a palestra
que nóis descobre,
    abestado!

                             42
42
42
42
“Being Social”

●
    Siga seus amigos




                              42
“Being Social”

●
    Acompanhe o desenvolvimento de projetos




                                              42
“Being Social”

●
    Contribua com o desenvolvimento de projetos




                                                  42
“Being Social”

●
    Junte os amigos e codifique junto




                                        42
Configurando o Git

●
    Baixar e Instalar o Git


    $ sudo apt-get install git-core




                                      42
Configurando o Git

●
    Gerando chave RSA [1]

$ cd ~/.ssh
$ ls
id_rsa id_rsa.pub know_hosts
$ mkdir key_backup
$ cp id_rsa* key_backup
$ rm id_rsa



                               42
Configurando o Git

●
    Gerando chave RSA [2]

$ ssh-keygen -t rsa seu@email.com
Generating public/private rsa key pair.
Enter file in which to save the key
(~/.ssh/id_rsa): <aperte enter>
Enter passphrase: <aperte enter>
Enter same passphrase again: <aperte enter>



                                              42
Configurando o Git

●
    Adicionando chave RSA ao seu Github [1]

~/.ssh $ cat id_rsa.pub
ssh-rsa <MINHA CHAVE>
romulo.machado5@gmail.com




                                              42
Configurando o Git
●
    Adicionando chave RSA ao seu Github [2]
    No github, vá em Account Settings > SSH Public Keys > Add another public key




                                                                                   42
Configurando o Git

●
    Testando se está tudo ok! [1]

$ ssh git@github.com
The authenticity of host 'github.com
(207.97.227.239)' can't be established.
RSA key fingerprint is …
Are you sure you want to continue
connecting (yes/no)? <digite yes>



                                          42
Configurando o Git

●
    Testando se está tudo ok! [2]

PTY allocation request failed on channel 0
Hi username! You' sucessfully authenticated,
but Github does not provide shell access.
Connection to github.com closed.




                                               42
Funcionou, companheiro!
         Issaê!




                          42
Configurando o Git

●
    Configurando usuário

$ git config --global user.name “Seu Nome”
$ git config --global user.email “seu@email”




                                               42
Administrando repositórios

●
    Criando um repositório




                                 42
Administrando repositórios




                             42
Difícil, né, gente?!




                       42
Adicionando código
$ mkdir ~/Hello-World

$ cd ~/Hello-World

$ git init
Initialized empty Git repository in ~/Hello-World/.git/

$ touch README




                                                          42
git status



             42
$ git status
# On branch master
# Initial commit
# Untracked files:
# (use “git add <file> … “ to include what will be commited)
#
# README
nothing added to commit but untracked files present




                                                               42
git add



          42
$ git add README




Pasta de trabalho             “Staging”
                    git add




                                          42
git commit



             42
$ git commit README -m “first commit”



   “Staging”               Repositório Local

                 git commit




                                               42
git remote



             42
$ git remote add origin
git@github.com:username/Hello-World.git




                                          42
git push



           42
$ git push origin master



                               Repositório
Repositório Local
                                Remoto

                    git push




                                             42
42
Pasta de trabalho                 “Staging”
                    git add
                                     git commit


  Repositório                  Repositório Local
   Remoto
                    git push


                                                   42
Conseguindo ajuda

http://google.com/

http://help.github.com/

http://book.git-scm.com/

http://nathanj.github.com/gitguide/




                                      42
Dúvidas?



       42
Obrigado!




            42
Contato

http://romulomachado.posterous.com/
  http://github.com/romulomachado
          @romulomachado_
     rcorreamachado@gmail.com



       Esta palestra estará disponível em:
      http://slideshare.net/romulomachado

                                             42
Imagens e Referências
http://bloggarcia.files.wordpress.com/2010/08/tiririca.jpg
http://www.quites.com.br/wp-content/uploads/2010/12/500px-Git-logo_svg.png
http://blog.upverter.com/wp-content/uploads/2011/03/github_logo.png
http://help.github.com/images/bootcamp/bootcamp_4_follow.jpg
http://help.github.com/images/bootcamp/bootcamp_4_watch.jpg
http://help.github.com/images/bootcamp/bootcamp_4_pull_requests.jpg
http://help.github.com/images/bootcamp/bootcamp_4_org.jpg
http://help.github.com/images/bootcamp/bootcamp_1_ssh.jpg
http://blogdofavre.ig.com.br/wp-content/uploads/2009/11/Lula_positivo.jpg
http://help.github.com/images/bootcamp/bootcamp_2_newrepo.jpg
http://help.github.com/images/bootcamp/bootcamp_2_repoinfo.jpg
http://g1.globo.com/VCnoG1/foto/0,,18316871-EX,00.jpg
http://help.github.com/images/bootcamp/bootcamp_2_updatedreadme.jpg
http://www.cs.bris.ac.uk/admissions/schools/Seminars/Images/C3PO.jpg
http://farm4.static.flickr.com/3073/2522402972_df135592e9_o_d.jpg
http://help.github.com/




                                                                             42

Github