git 使用记录
2012-03-02 17:48
337 查看
git init 创建一个新的git repository
git clone 从远程
git status git库现在文件变化情况,可以用git status -s 比较方便阅读。
git diff 去获取已经归纳进版本库的文件与内存中版本的变化,及没有git add 但是已经在库中的文件与内存中的版本变化
git diff --cached 去获取已经git add与内存中的版本变化
git diff HEAD 就是 git diff 加上 git diff --cached
git add 纳入到版本库中
git commit -m 提交到本地版本库中
git commit -a 自动将所有trace的都给提交
git reset HEAD filename 将stage的文件退回到unstage的状态
git rm 将文件从stage状态彻底删除
git mv 将版本库文件改名
git branch 列出现在所有branch
git branch (branch name) 生成一个新的branch
git branch -d (branch name) 删除一个branch
git checkout (branch name)切换到一个branch中
git merge (branch name)将现在的branch与提供的branch合并
git log 显示日志
git log --oneline 一行显示一条日志
git remote 显示remote的repository名称
git remote -v 看到实际的repository地址
git remote add 添加新的repository地址
git remote rm 删除repository地址
git fetch 从远端的repository获得最新的代码,放到一个临时的branch中
git pull 从远端的repository获得最新的代码,并且merge
git push [alias] [branch] 将现在的代码push到远端alias指定的git库中的branch分支中
当然安装完成后,需要config相关配置
git clone 从远程
git status git库现在文件变化情况,可以用git status -s 比较方便阅读。
git diff 去获取已经归纳进版本库的文件与内存中版本的变化,及没有git add 但是已经在库中的文件与内存中的版本变化
git diff --cached 去获取已经git add与内存中的版本变化
git diff HEAD 就是 git diff 加上 git diff --cached
git add 纳入到版本库中
git commit -m 提交到本地版本库中
git commit -a 自动将所有trace的都给提交
git reset HEAD filename 将stage的文件退回到unstage的状态
git rm 将文件从stage状态彻底删除
git mv 将版本库文件改名
git branch 列出现在所有branch
git branch (branch name) 生成一个新的branch
git branch -d (branch name) 删除一个branch
git checkout (branch name)切换到一个branch中
git merge (branch name)将现在的branch与提供的branch合并
git log 显示日志
git log --oneline 一行显示一条日志
git remote 显示remote的repository名称
git remote -v 看到实际的repository地址
git remote add 添加新的repository地址
git remote rm 删除repository地址
git fetch 从远端的repository获得最新的代码,放到一个临时的branch中
git pull 从远端的repository获得最新的代码,并且merge
git push [alias] [branch] 将现在的代码push到远端alias指定的git库中的branch分支中
当然安装完成后,需要config相关配置
$ git config --global user.name "Firstname Lastname" Sets the name of the user for all git instances on the system
$ git config --global user.email "your_email@youremail.com"
相关文章推荐
- Git使用手册/Git教程:git log 查看git提交版本历史日志记录
- Git 使用记录
- git 工具的使用总结(5)-查看历史记录
- Eclipse上GIT插件EGIT使用手册之五_查看历史记录
- 好记性不如烂笔头-----git使用问题记录
- git使用记录
- Git与GitHub版本控制使用记录
- git的使用方法记录
- Windows下,在Git Bash中使用git log命令查看历史记录时,出现乱码的解决方法
- Git日常使用记录
- 使用gogs搭建git服务器记录
- Git使用点滴记录: You have no permission to access this repo.
- 记录使用git老是出现用户密码错误的情况
- Git命令行使用学习记录
- Eclipse上GIT插件EGIT使用手册之五_查看历史记录
- VS2015 Git 源代码管理工具使用记录
- git使用记录
- 关于Android使用git版本管理工具的一点记录
- git使用记录
- git 使用记录