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

git使用笔记 bitbucket基本操作

时间:2017-07-24 18:55:03      阅读:526      评论:0      收藏:0      [点我收藏+]

标签:car   bitbucket   git init   本地仓库   led   一个   class   one   git   

实现目标:

1.将本地已经存在的项目文件保存到 bitbucket.org
2.从 bitbucket.org 检出代码库到本地

操作笔记:
1.首先在bitbucket.org创建一个代码库,并得到代码库的地址 https://username@bitbucket.org/username/ledcard.git
2.打开Git Bash,进入到项目工程目录
$ cd D:/cygwin/usr/LedCard/
3.创建本次git仓库
$ git init
4.添加和提交
$ git add * #将工程目录下所有文件添加到缓存目录(Index)
$ git commit -m “提交注释” #将文件提交到HEAD,但是这些提交还在本地,还没有在远端仓库
5.推送改动
将本地仓库连接到远端仓库
$ git remote add origin https://username@bitbucket.org/username/ledcard.git
推送到远端仓库
$ git push -u origin –all
6.完成,打开 bitbucket.org ,查看该代码仓库,可以看到文件都已上传
7.检出代码库
切换到需要的目录
$ cd e:
$ mkdir ledcard
$ cd ./ledcard/
检出远端仓库
$ git clone https://username@bitbucket.org/username/ledcard.git
8.完成,打开本地目录,查看文件,可以看到文件已经全部检出。

参考文档:http://rogerdudler.github.io/git-guide/index.zh.html

git使用笔记 bitbucket基本操作

标签:car   bitbucket   git init   本地仓库   led   一个   class   one   git   

原文地址:http://www.cnblogs.com/fdyang/p/7230260.html

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