git shell

首先安装git shell :https://code.google.com/p/msysgit/downloads/list/ 基本上一路下一步就可以了。

尽管有图形界面,但是我还是喜欢用command,至于为什么,很简单,因为我会觉得我很高深!

然后你有github吧?好吧,虽然我也有csdncode,但是我总觉得那货不太靠谱,所以还是github吧。

在github中创建个项目,填了项目名提交后就会提示在命令行中应该怎么做了,就是这么个界面。

好吧,我们到本地创建个目录作为仓库。我的目录就叫GitHub,然后从开始菜单中选择Git/Git Bash进入git的命令行界面,按照上面的来吧。

切换到GitHub目录:

1
2
cd d:
cd github

然后执行上图中的那些个代码就好了。

当然,如果你第一次安装这些,可能会遇到问题,解决方法都有下面这些,但是我却记不住哪出来的了。

不过,首先需要本地的sshkey,https://help.github.com/articles/generating-ssh-keys

我做的是这些:

1
2
3
4
5
cd ~/. ssh
ssh -keygen -t rsa -C "your_email@example.com"
#Enter passphrase (empty for no passphrase): [Type a passphrase]
#Enter same passphrase again: [Type passphrase again]
clip < ~/. ssh /id_rsa .pub

执行完clip < ~/.ssh/id_rsa.pub之后key就被复制了,然后进入https://github.com/settings/profile选择“SSH Keys”然后点右边的Add SSH Key按钮,直接到Key下面的文本框中粘贴Title不写,点下面的Add Key就可以了。

在回来继续:

1
ssh -T git@github.com

输入Enter passphrase的时候输入的密码看是否成功了,失败了就再找原因吧,因为我还没遇到。

然后提交代码阶段

1
2
3
git add .
git commit -m "first_commit"
git push origin master

写的不详细,但就是这样,以后遇到问题再补完吧。

Git指令的Shell脚本,能够快速便捷地管理Git库,包括添加修改、提交修改、显示库状态、推送到远程库、从远程库更新到本地、版本恢复等操作。 使用方法: 1. 在Linux系统中,将本文件放在Git库目录下,利用Shell运行本文件; 2.在windows系统中,需下载安装与操作系统相对应的Git软件,并将本文件放在Git库目录下,双击即可运行。 运行示例: Please choose the first letter of options. [Add|Commit|Diff|Fetch|Exit|Help|Log|Push|User|Reset|Status]? h A: Add all changes to repository. C: Commit all changes to repository. D: Show differences between current version with HEAD->. E: Exit shell script. F: Fetch origin/master and merge. L: Show latest two-weeks logs of repository. P: Push commissions to origin/master. U: User command mode(Press ‘Enter’ to exit). R: Reset current version according version_id. S: Show status of repository. Please choose the first letter of options. [Add|Commit|Diff|Fetch|Exit|Help|Log|Push|User|Reset|Status]? s On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: Git.sh modified: PyNote/PyNote_2.md no changes added to commit (use "git add" and/or "git commit -a") Please choose the first letter of options. [Add|Commit|Diff|Fetch|Exit|Help|Log|Push|User|Reset|Status]? a On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD ..." to unstage) modified: Git.sh modified: PyNote/PyNote_2.md
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值