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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)