git remote –v 查看远端地址
git config –list 查看配置
git remote set-url origin 你的远端地址
git config –global user.name “用户名”
git config –global user.email 邮箱地址
git add .
git commit -m “本次要提交的概要信息”
git push origin master
git push
git push --force origin
上面命令使用-–force
选项,结果导致在远程主机产生一个”非直进式”的合并(non-fast-forward merge)。除非你很确定要这样做,否则应该尽量避免使用–-force
选项。
down下线上代码版本,抛弃本地的修改
不建议这样做,但是如果你本地修改不大,或者自己有一份备份留存,可以直接用线上最新版本覆盖到本地
git fetch --all
git reset --hard origin/master
git fetch
git config --global credential.helper store
你会在你本地生成一个文本,上边记录你的账号和密码。下次git pull/push就不用输入帐号密码了
git config --system --unset credential.helper
更换密码后,需要 unset credential.helper