• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

三木筒子

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

git常用操作

1. 切换到被copy的分支(master),并且从远端拉取最新版本

$git checkout master

$git pull

2. 从当前分支拉copy开发分支

$git checkout -b dev

Switched to a new branch 'dev'

3. 把新建的分支push到远端
$git push origin dev

4. 拉取远端分支
$git pull

There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> dev

经过验证,当前的分支并没有和本地分支关联,根据提示进行下一步:
5. 关联

$git branch --set-upstream-to=origin/dev
6. 再次拉取 验证

$git pull

 

 

add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
reset Reset current HEAD to the specified state(可用于撤销操作) 如: git reset --soft head(头信息)
rm Remove files from the working tree and from the index(警用)

 

如有错误,请邮件zs253499660@sina.com,如有更好的方法,可以推荐

posted on 2020-07-08 22:11  森酱  阅读(160)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3