gitbox 使用教程怎么用

Git教學:Git的遠端操作及利用Dropbox建立Server進行協同開發(Windows)Git常用操作指南_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
Git常用操作指南
上传于||文档简介
&&G​i​t​常​用​操​作​指​南​ ​ ​操​作​命​令
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
下载文档到电脑,查找使用更方便
还剩4页未读,继续阅读
你可能喜欢Pro Git(中文版)
Pro Git(中文版)
| Git 手册 |最近一直在学习使用git来管理自己的程序,总是今天东学一点,明天西凑一点,到用的时候,总是有些茫然不知所措。
在博客园里看见一篇老好的文章,教我们做笔记啦,但是做完笔记还是要记得总结哦!
来吧,让我们一起来总结吧,今天先来看看git远程的仓库是怎么建立的。
当然,使用git嘛,第一步肯定是得新建一个git仓库,总得有个操作的空间吧,巧妇难为无米之炊嘛。
1.初始化一个空的git仓库
1 software@debian:~$ mkdir yafeng
2 software@debian:~$ cd yafeng/
3 software@debian:~/yafeng$ ls
4 software@debian:~/yafeng$ git init
5 Initialized empty Git repository in /home/software/yafeng/.git/
6 software@debian:~/yafeng$
命令注释:
在上面的命令中,真正去初始化的是第四行的那句---git init
当然,还有很多同学会看见加了参数--bare的命令,这个命令会在我们以后慢慢给大家解释,对于不是作为共享仓库,而是作为一个自己操作的仓库,上面这样就足够了。
好了,现在yafeng目录就是我们的据点---git仓库了哦。
下面我们总要做点什么的吧,入宝山总不能光看着哦:
2.向仓库提交我们写的文件
1 software@debian:~/yafeng$ echo "our first git repository" && file
2 software@debian:~/yafeng$ ls
4 software@debian:~/yafeng$ git add file
5 software@debian:~/yafeng$ git commit -m "the first file to commit" file
6 [master (root-commit) 0c72641] the first file to commit
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 file
9 software@debian:~/yafeng$
命令解释:我们在仓库中新建了一个文件file,作为我们的示例文件。
第4行:将file文件的信息添加到git仓库的索引库中,并没有真正添加到库。当然上例中的file文件只是我们的示例,它是一个路径,因此,可以是文件,更可以是目录。
第5行:将索引库中的内容向git仓库进行提交。这步之后文件file才算真正提交到拉git仓库中。双引号中的内容是根据每次修改的不同内容,由我们自己去填写的,
很多人会看见
  git commit -a -m & &
这条的命令是在你已经add了一个或多个文件过之后,然后修改了这些文件,就可以使用该命令进行提交。
好了,不管怎么样,终于是将文件提交到库了。可是现在的仓库只是一个本地的仓库,我们的目标是变成远程仓库哦,继续吧。
3.在本地仓库添加一个远程仓库,并将本地的master分支跟踪到远程分支
1 software@debian:~/yafeng$ git remote add origin ssh://software@172.16.0.30/~/yafeng/.git
2 software@debian:~/yafeng$ git push origin master
3 software@172.16.0.30's password:
4 Everything up-to-date
5 software@debian:~/yafeng$
第1行:在本地仓库添加一个远程仓库,当然ssh后面的地址是我们本地仓库的地址.
第2行:将本地master分支跟踪到远程分支,在git仓库建立之初就会有一个默认的master分支,当然你如果建立了其他分支,也可以用同样的方法去跟踪.
对于分支的事情,我们会在以后细细的讲述.
做到拉这一步了吗?我告诉你,你已经完成目的了哦,现在的git仓库已经是一个远程仓库了,
不相信吗?我们来测试一次阿:
现在本机上看看:
1 software@debian:~/yafeng$ git remote show origin
2 software@172.16.0.30's password:
3 * remote origin
Fetch URL: ssh://software@172.16.0.30/~/yafeng/.git
URL: ssh://software@172.16.0.30/~/yafeng/.git
HEAD branch: master
Remote branch:
master tracked
Local ref configured for 'git push':
master pushes to master (up to date)
11 software@debian:~/yafeng$
第1行:显示远程信息
很多看见这还是会不以为然的,这又能说明什么呢?好,那就来点实际的:
在另一个机子上,远程clone
1 root@yafeng-VirtualBox:~# ls
3 root@yafeng-VirtualBox:~# git clone ssh://software@172.16.0.30/~/yafeng/.git
4 Cloning into yafeng...
5 software@172.16.0.30's password:
6 remote: Counting objects: 9, done.
7 remote: Compressing objects: 100% (3/3), done.
8 remote: Total 9 (delta 0), reused 0 (delta 0)
9 Receiving objects: 100% (9/9), done.
10 root@yafeng-VirtualBox:~# ls
12 root@yafeng-VirtualBox:~# cd yafeng/
13 root@yafeng-VirtualBox:~/yafeng# ls
15 root@yafeng-VirtualBox:~/yafeng#
第3行:就是远程clone仓库.很明显的对比可以知道多了yafeng目录,而这个yafeng目录里的内容和我们另外一台机子上的内容一样
至此,一个简单的git远程仓库就建好了,简单不,试试吧!!
阅读(...) 评论()Gitbox — The version control app on a Mac
Five stars on the App Store!
One-click commit, push and pull. Unique search in history and undo for Git commands.
Powerful commands like rebase, branch reset and cherry picking. And now it works with submodules.
Simple design. Advanced features.
Gitbox integrates with popular diff tools such as , , , .
Use keyboard for ultimate efficiency. Use arrow keys to jump between all the panes and lists.
To stage all files, hit Cmd+Shift+Return. To stage/unstage selected files, use "S" shortcut.
To pull and push, use "U" and "P" shortcuts. Press Option key to perform fetch. Press Cmd+Shift to force push or rebase.
Right click menus contain all the advanced features you might need. For instance, to reset a branch, cherry pick a commit or revert a file.
To amend a commit, simply undo it (cmd+Z). You can also undo merge, pull and even push.
To find a bug, use color labels. Check out a commit, test it and mark if it works or not. This is a much better and visual approach than git-bisect.
“Version control outside the Terminal is usually a clusterfuck. Gitbox looks the most straightforward that I've seen thus far.”
Mark Otto, UI designer at Twitter.
“I’ve started really, really liking Git since getting Gitbox. Nice, clean, simple, works.”
Wil Shipley, Cocoa Legend.
“Finally a glorious Mac app for managing Git repositories. Thank the lord!”
Brennan Novak, designer, musician, developer.
“[Gitbox isEqualTo:Awesome];”
Calvin W. Stephens IV, software developer and designer.
Requirements
Mac with 64-bit processor.
OS X Lion or Snow Leopard.
For Snow Leopard users: libcurl 7.0.0 or later (must be in /usr/lib).
To open diffs with FileMerge do the following:
1. Install the latest
from App Store.
2. In Xcode Preferences: download and install Command Line Tools.
3. In Terminal: sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
How to buy
Gitbox is offered on both Mac App Store and with an old-school license. Both builds are the same and distributed on the same conditions: the license is for personal use, on any number of machines. Updates are free.
Students are offered 50% discount coupon (a scan of student ID required).
There is a discount for volume purchases.
for details.
Ask a question by email
or using twitter .
Gitbox is designed by Oleg Andreev, a software designer from Paris, France.

我要回帖

更多关于 gitbox mac 的文章

 

随机推荐