您的位置:首页 > 其它

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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: