您的位置:首页 > 其它

Git使用笔记

2015-01-25 11:00 239 查看
与github账号关联
https://help.github.com/articles/generating-ssh-keys/ Generating SSH keys

Step 1: Check for SSH keys

First, we need to check for existing SSH keys on your computer. Open up your Git Bash and type:

~/.ssh

# Lists the files in your .ssh directory, if they exist

Step 2: Generate a new SSH key

ssh-keygen -t rsa -C "your_email@example.com"

# Creates a new ssh key, using the provided email as a label

# Generating public/private rsa key pair.

# Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter]

Step 3: Add your SSH key to your account

Step 4: Test everything out

ssh -T git@github.com

# Attempts to ssh to GitHub

or create a new repository on the command line

touch README.md

git init #初始化git

git add README.md #添加文件

git commit -m "first commit"
#提交到本地库中

…or push an existing repository from the command line

git remote add origin https://github.com/hua345/canvas.git #添加远程地址,并命名(如:origin)

git push -u origin master #提交本地代码到github上

git中Vim使用

vim .gitignore就可以创建.gitignore文件

进入之后是VIM的普通模式,按 i 键,进入INSERT模式,这是可以输入message了。

输入完成之后,按ESC键进入命令模式 ,输入冒号(在窗口下面显示),然后输入x,回车就OK了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: