Git 版本管理 add rm commit push pull

$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"

$ git remote add origin https://XXXX

$ git init

git add filename

git commit -m "comment message"

添加新内容

git add

git status

git commit -m‘add something’ (add something为备注)

git push

删除文件(文件夹)

git rm Date -r -f

git commit -m'delete something'(delete somgthing 备注)

git push

branch

git branch

git branch new

git push origin new

git checkout new

git branch -d new

git branch -r -d origin/new

git push origin :new

clone 分支

git clone -b develop https://git.XXX.git

git add -A = git add . + git add -u

  • git add -A   stages All
  • git add .   stages new and modified, without deleted
  • git add -u     stages modified and deleted, without new

git reset --hard FETCH_HEAD

git pull

Error:

You are not currently on a branch.

git checkout -b temp

git checkout master

git pull

原文地址:https://www.cnblogs.com/fangchun/p/4639907.html