git commands
2015-10-12 08:28
274 查看
GIT COMMANDS
------------
Configuration
Configure your username
$ git config --global user.name "Your Name"
Configure your username
$ git config --global user.username githubusername
Configure your email
$ git config --global user.email youremail@example.com
Check in
Check status of changes to a repository
$ git status
View changes between commits
$ git diff
Add a file's changes to be commited
$ git add <FILENAME>
To add all files' changes
$ git add .
To commit (aka save) the changes you've added with a
short
message describing the changes
$ git commit -m "your commit message"
Remotes
To push your changes to a remote
$ git push <REMOTENAME>
<BRANCHNAME>
To pull in changes from remote
$ git pull <REMOTENAME>
<BRANCHNAME>
To set a URL for a remote
$ git remote set-url
<REMOTENAME>
<BRANCHNAME>
Add a remote
$ git remote add <REMOTENAME>
<BRANCHNAME>
Branches
Merge a branch into current branch
$ git merge <BRANCHNAME>
Change the branch you're working on
$ git checkout
<BRANCHNAME>
Delete a local branch
$ git branch -D
<BRANCHNAME>
Delete a remote branch
$ git push <REMOTENAME>
--delete <BRANCHNAME>
------------
Configuration
Configure your username
$ git config --global user.name "Your Name"
Configure your username
$ git config --global user.username githubusername
Configure your email
$ git config --global user.email youremail@example.com
Check in
Check status of changes to a repository
$ git status
View changes between commits
$ git diff
Add a file's changes to be commited
$ git add <FILENAME>
To add all files' changes
$ git add .
To commit (aka save) the changes you've added with a
short
message describing the changes
$ git commit -m "your commit message"
Remotes
To push your changes to a remote
$ git push <REMOTENAME>
<BRANCHNAME>
To pull in changes from remote
$ git pull <REMOTENAME>
<BRANCHNAME>
To set a URL for a remote
$ git remote set-url
<REMOTENAME>
<BRANCHNAME>
Add a remote
$ git remote add <REMOTENAME>
<BRANCHNAME>
Branches
Merge a branch into current branch
$ git merge <BRANCHNAME>
Change the branch you're working on
$ git checkout
<BRANCHNAME>
Delete a local branch
$ git branch -D
<BRANCHNAME>
Delete a remote branch
$ git push <REMOTENAME>
--delete <BRANCHNAME>
相关文章推荐
- greasemonkey&nbsp;jquery
- Hibenate枚举类型
- hibernate 注解配置
- Junit4&nbsp;Hamcrest
- Android&nbsp;Support&nbsp;Sample项目
- Failed&nbsp;to&nbsp;open&nbsp;the&nbsp;HAX&nbsp;device!
- std::set&nbsp;iterator
- c++&nbsp;new&nbsp;分配内存注意
- vs2010&nbsp;远程调试
- C++&nbsp;指针学习累积(持续)
- C++&nbsp;记录
- pywin32&nbsp;各版本下载
- 编译MongoDB&nbsp;及驱动
- mongodb&nbsp;js使用
- Mongodb&nbsp;shard&nbsp;&amp;&amp;&nbsp;shardkey
- MongoDB&nbsp;复制集配置
- Window&nbsp;bat判断文件是否存在…
- c++随机数生成
- mongdb&nbsp;driver&nbsp;失败告终&nbsp;记录
- Java的中间缓存变量机制