码迷,mamicode.com
首页 > 其他好文 > 详细

git常用命令整理

时间:2018-04-22 13:11:53      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:name   nal   ant   min   struct   config   col   AC   conf   

You have an empty repository

To get started you will need to run these commands in your terminal.

Configure Git for the first time

git config --global user.name "fhw"
git config --global user.email "fhw@xxx.com"

Working with your repository

I just want to clone this repository

If you want to simply clone this empty repository then run this command in your terminal.

git clone ssh://git@git.xxx.com/~fhw/demo.git

My code is ready to be pushed

If you already have code ready to be pushed to this repository then run this in your terminal.

cd existing-project
git init
git add --all 或者 git add .
git commit -m "Initial Commit"
git remote add origin ssh://git@git.xxx.com/~fhw/demo.git
git push origin master

My code is already tracked by Git

If your code is already tracked by Git then set this repository as your "origin" to push to.

cd existing-project
git remote set-url origin ssh://git@git.xxx.com/~fhw/demo.git
git push origin master

 

 

git常用命令整理

标签:name   nal   ant   min   struct   config   col   AC   conf   

原文地址:https://www.cnblogs.com/fhwup/p/8906021.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!