git 覆盖本地修改 ,git 放弃本地修改,强制更新

git fetch --all
git reset --hard origin/master

git fetch 只是下载远程的库的内容,不做任何的合并 git reset 把HEAD指向刚刚下载的最新的版本

 

 

 

git branch
查看分支

git branch develop

缓存修改到本地,提交修改,更新代码,提交修改到远程库

 

 

 

 

远程仓库的使用

    查看当前的远程库
        git remote 命令,它会列出每个远程库的简短名字和地址。在克隆完某个项目后,至少可以看到一个名为 origin 的远程库,Git 默认使用这个名字来标识你所克隆的原始仓库。
    添加远程仓库
        git remote add [shortname] [url]
        现在就可以用shortname来pull 和push了
        git push [shortname]
    远程仓库的删除和重命名
        git remote rename old_name new_name
        git remote rm name

第一次pull的时候还要用全称,最后再加master

 

 

 

 

创建本地tag:
git tag -a v2014 -m "新建tag v2014"

把本地分之推到远端服务器:
git push --tags

删除本地tag:
git tag -d v2014

删除远程tag:
git push origin --delete v2014

 

相关文章:

  • 2022-02-08
  • 2021-08-29
  • 2022-01-09
  • 2021-10-19
  • 2022-02-23
  • 2022-02-10
猜你喜欢
  • 2022-12-23
  • 2021-09-18
  • 2021-06-01
  • 2021-09-23
  • 2021-08-21
相关资源
相似解决方案