SlideShare a Scribd company logo
1 of 15
Seis passos para se colocar um
projeto em um servidor próprio.
Para quem tem um projeto no servidor, mas não sabe como colocá-lo em controle de
versão.
Objetivo
Configurar um ambiente para que seja
possível colocar um projeto que está no
servidor em controle de versão.
Caso você tenho o projeto na máquina local, mas queria
upar no servidor acesse: http://goo.gl/BqM0NZ
Mas primeiro...
Não é preciso que você seja um expert em nenhum do
assuntos abaixo, mas tenha conhecimento básico:

Controle de Versionamento GIT
http://pt.wikipedia.org/wiki/Git / http://gitimmersion.com/

Conexão SSH
http://pt.wikipedia.org/wiki/SSH

Familiaridade com os terminais, ou prompt da
vida(Depende do S.O. do seu servidor).
Comandos básicos: entrar, sair, criar e deletar pastas.
Introdução(1)
Muito se houve falar do controle de versão utilizando
repositórios tais como:

BitBucket

Github

Gitorius
Entre outros...
Introdução(2)
Mas e se eu quiser colocar o meu projeto
que está em servidor próprio em controle
de versão?
Como faço para colocá-lo em controle de
versão? E upar as mudanças locais?
Introdução(3)
É justamente isto que proponho lhe ajudar a
fazer...
Colocar o seu projeto que está em um servidor
próprio em controle de versão utilizando o GIT via
SSH.
Utilizei o S.O. Ubuntu(Linux), mas é possível no
Windows(usando: putty ssh, git) e no MAC.
Suponho que você já tenha instalado o git, ssh na
sua máquina.
Passo nº 1 – Buscando informação...
A primeira coisa que se deve saber é saber
se o seu servidor permite acesso via SSH e
se ele é Linux.
Como? Entrando em contato com eles.
Aproveite e peça o link(ou ip), usuário e
senha de acesso, caso seja possível.
Normalmente o usuário e a senha é o
mesmo da conta FTP.
Passo nº 2 – Preparando o ambiente
Se você já colocou o seu projeto local em
controle de versão, basta fazer o primeiro
commit.
Caso contrário coloque-o. Abaixo tem um link
de ajuda:
http://tableless.com.br/iniciando-no-git-parte-
1/#.Ujgy97zoFUE
Não esqueça de fazer o commit.
Passo nº 3 – Acessando o servidor
Usuário Linux ou MAC:
execute o comando, no terminal:
ssh usuario@endereco
vai pedir a senha você coloca e pronto está no servidor
Usuário windows:
Configurar o putty com usuario, endereco e porta.
O usuario e endereco são os mencionados no slide anterior;
Nos dois casos estarão em um terminal.
Passo nº 4 – Versionando projeto no Servidor
Supondo que você tenha a pasta do
projeto já criada no servidor, exemplo
teste.com.br, e que a pasta está dentro da
pasta public_html.
Na verdade, não importa onde o projeto
esteja, mas a nível de entendimento
vamos supor o que foi descrito acima.
Passo nº 4 – Versionando projeto no Servidor(2)
Vá até a pasta do projeto, teste.com.br. Para isto
você só irá precisar usar os comandos ls e cd.[1].
Digite pwd e aperte Enter para saber o caminho do
diretório que você está.
Algo parecido com: /home/usuario/public_html/teste.com.br
Dentro da pasta acima.
Digite git init e aperte enter.
Passo nº 4 – Versionando projeto no Servidor(2)
Fazendo o primeiro commit.
– Execute o comando:
git add *
– Agora execute:
git commit -am “First Commit”
Passo nº 5 – Clonando o servidor
No repositório local, vamos baixar o projeto do servidor:
git clone
ssh://usuario@endereco/home/usuario/public_html/teste.c
om.br/.git/
Para mandar as mudanças locais para o servidor, após o
commit local executar o comando:
git push origin master
Sobre do autor
Marcos Silva
https://www.facebook.com/massilva1
http://www.linkedin.com/in/massilva
@marcossilva
marcos@develops6.com
http://develops6.com/
Imagem em: http://findicons.com/search/inside
Link's importantes
[1] http://wiki.ubuntu-br.org/ComandosBasicos

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Passos para colocar um projeto no servidor em controle de versao git

  • 1. Seis passos para se colocar um projeto em um servidor próprio. Para quem tem um projeto no servidor, mas não sabe como colocá-lo em controle de versão.
  • 2. Objetivo Configurar um ambiente para que seja possível colocar um projeto que está no servidor em controle de versão. Caso você tenho o projeto na máquina local, mas queria upar no servidor acesse: http://goo.gl/BqM0NZ
  • 3. Mas primeiro... Não é preciso que você seja um expert em nenhum do assuntos abaixo, mas tenha conhecimento básico:  Controle de Versionamento GIT http://pt.wikipedia.org/wiki/Git / http://gitimmersion.com/  Conexão SSH http://pt.wikipedia.org/wiki/SSH  Familiaridade com os terminais, ou prompt da vida(Depende do S.O. do seu servidor). Comandos básicos: entrar, sair, criar e deletar pastas.
  • 4. Introdução(1) Muito se houve falar do controle de versão utilizando repositórios tais como:  BitBucket  Github  Gitorius Entre outros...
  • 5. Introdução(2) Mas e se eu quiser colocar o meu projeto que está em servidor próprio em controle de versão? Como faço para colocá-lo em controle de versão? E upar as mudanças locais?
  • 6. Introdução(3) É justamente isto que proponho lhe ajudar a fazer... Colocar o seu projeto que está em um servidor próprio em controle de versão utilizando o GIT via SSH. Utilizei o S.O. Ubuntu(Linux), mas é possível no Windows(usando: putty ssh, git) e no MAC. Suponho que você já tenha instalado o git, ssh na sua máquina.
  • 7. Passo nº 1 – Buscando informação... A primeira coisa que se deve saber é saber se o seu servidor permite acesso via SSH e se ele é Linux. Como? Entrando em contato com eles. Aproveite e peça o link(ou ip), usuário e senha de acesso, caso seja possível. Normalmente o usuário e a senha é o mesmo da conta FTP.
  • 8. Passo nº 2 – Preparando o ambiente Se você já colocou o seu projeto local em controle de versão, basta fazer o primeiro commit. Caso contrário coloque-o. Abaixo tem um link de ajuda: http://tableless.com.br/iniciando-no-git-parte- 1/#.Ujgy97zoFUE Não esqueça de fazer o commit.
  • 9. Passo nº 3 – Acessando o servidor Usuário Linux ou MAC: execute o comando, no terminal: ssh usuario@endereco vai pedir a senha você coloca e pronto está no servidor Usuário windows: Configurar o putty com usuario, endereco e porta. O usuario e endereco são os mencionados no slide anterior; Nos dois casos estarão em um terminal.
  • 10. Passo nº 4 – Versionando projeto no Servidor Supondo que você tenha a pasta do projeto já criada no servidor, exemplo teste.com.br, e que a pasta está dentro da pasta public_html. Na verdade, não importa onde o projeto esteja, mas a nível de entendimento vamos supor o que foi descrito acima.
  • 11. Passo nº 4 – Versionando projeto no Servidor(2) Vá até a pasta do projeto, teste.com.br. Para isto você só irá precisar usar os comandos ls e cd.[1]. Digite pwd e aperte Enter para saber o caminho do diretório que você está. Algo parecido com: /home/usuario/public_html/teste.com.br Dentro da pasta acima. Digite git init e aperte enter.
  • 12. Passo nº 4 – Versionando projeto no Servidor(2) Fazendo o primeiro commit. – Execute o comando: git add * – Agora execute: git commit -am “First Commit”
  • 13. Passo nº 5 – Clonando o servidor No repositório local, vamos baixar o projeto do servidor: git clone ssh://usuario@endereco/home/usuario/public_html/teste.c om.br/.git/ Para mandar as mudanças locais para o servidor, após o commit local executar o comando: git push origin master
  • 14. Sobre do autor Marcos Silva https://www.facebook.com/massilva1 http://www.linkedin.com/in/massilva @marcossilva marcos@develops6.com http://develops6.com/ Imagem em: http://findicons.com/search/inside