git 常用 config命令
$ git config -global user.name "Your Name Here"
$ git config -global user.email "your_email@example.com"
$ git config -list
$ exit
Adding(workspace to index)
$ git add. %adds all new files
$ git add -u %update tracking for files that changed names or were deleted
$ git add -A %does both of the previous
commit( index to local repository)
$ git commit -m "message" %where message is a useful description of what you do
push(local repository to remote repository)
$ git push
branches(想在原代码基础上做新代码,但是不愿意改原代码)
$ git checkout -b branchname %create a branch
$ git branch % to see what branch you are on
$ git checkout master %back to the master branch type
pull request 要求将自己的代码加入主程序,有个按钮。
——————————————————————————————-
Initialize a local Git repository in the directory
$ git init
将本地repository和github上的远程 repository相连
$ git remote add origin https://github.com/yourUserNameHere/test-repo.git
——————————————————————————————-
如何在他人的github代码基础上进行开发:
点击”Fork”按钮,会将代码复制到自己的github下。
将该repository复制到本地:
$git clone http://github.com/yourUserNameHere/repoNameHere.git