git 本地文件上传 github

如果本地文件有.git 目录 查看远程地址 $ git remote -v ,要先把本地.git文件删除掉,再把git远程地址删除掉 $ git remote rm origin ,然后添加需要上传的git远程地址,

列如  $  git remote add origin https://github.com/wwf1225/test3.git ,与远程git绑定好后,可以查看远程地址 $ git remote -v 看一下是否正确,然后 $ git add .  添加所有文件,再然后 $ git commit -m "初次提交"

再然后 $ git push -u origin master(master 默认分支) ,就成功上传了

1. $ git remote rm origin   (如果有需要的话执行这一步)

2. $ git init 

3. $  git remote add origin https://github.com/wwf1225/test3.git   (绑定远程git地址)

4. $ git add . 

5. $ git commit -m "初次提交的说明" 

6. $ git push -u origin master    (master 默认分支)

猜你喜欢

转载自blog.csdn.net/wwf1225/article/details/113860316