Ruby on Rails Tutorial the first chapter of GIT project management

Source: Internet
Author: User
Tags ruby on rails

1. Installation and Setup

(1) Git installation (slightly)

(2) Initialization settings

$ git config--global user.name "Lihuasun"

$ git config--global user.email "12***[email protected]**.com"

$ git config--global push.default matching #向后兼容新的git版本

(3) The first time to use the warehouse to do the setup

$ git init

$ git add-a

$ git status

$ git commit-m "Initialize repository"

$ git log

(4) Public Key Management

$ ssh-keygen-t rsa-c "[email protected]" #生成公钥

$ cat ~/.ssh/id_rsa.pub #复制公钥

(5) Add Hello_app Warehouse on GitHub (slightly)

(6) Add remote repository and push

$ git Remote add origin [email protected]:lihuasun/hello_app.git

$ git push-u origin--all #第一次推送仓库

2. Branch, edit, submit, merge, push

(1) Branch

$ git checkout-b modify-readme #创建分支

$ git Branch #查看分支

(2) Edit

$ git mv Readme.rdoc readme.md

$ git checkout-f #强制撤销改动

(3) Submit

$ git status #查看分支状态

$ git add-a #如果上次提交之后添加了新文件, you want to execute this command

$ git commit-a-M "Improve the README file"

(4) Merger

$ git Checkout master #切换到主分支

$ git merge Modify-readme #合并分支

$ git brandh-d modify-readme #删除分支, when using-D, discard changes in the branch

(5) Push

$ Git push origin master #其中origin master often omitted

Ruby on Rails Tutorial the first chapter of GIT project management

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.