git一些操作:

1 实现本地仓库项目添加到远程仓库:

将远程仓库与本地仓库关联

git remote add origin http://gitlab.hxdev.cn/*****  

添加本地项目到本地仓库

git add .

提交

git commit -m "****"

推送到远程仓库(首次推送加-u)

git push -u origin master

然后输入账号密码。

如图:

Git 一些基本操作

成功:

Git 一些基本操作

2 fork别人的代码,同步更新fork的代码

git remote -v git remote add upstream [email protected]:xxx/xxx.git

git fetch upstream

git merge upstream/master

git push

如图:

Git 一些基本操作

Git 一些基本操作

Git 一些基本操作

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2022-02-12
  • 2021-11-17
  • 2021-08-15
  • 2021-06-15
  • 2021-08-17
  • 2022-12-23
猜你喜欢
  • 2021-07-08
  • 2021-09-02
  • 2022-01-03
  • 2022-01-08
  • 2021-09-29
  • 2022-01-12
  • 2021-11-22
相关资源
相似解决方案