git常用命令以及出现的错误解决方法

-------------------------------------------随时更新--------------------------------

一、git常用命令

1、git add . 

2、git commit -m 'xxxx'

3、git pull    更新git代码

4、git push  提交git代码

5、git init    初始化git

二、git命令出现错误以及解决方法

1、Git: There is no tracking information for the current branch.

在执行git pull的时候,提示当前branch没有跟踪信息:

 

1 git pull
2 There is no tracking information for the current branch.
3 Please specify which branch you want to merge with.

对于这种情况有两种解决办法,就比如说要操作master吧,一种是直接指定远程master:

1 git pull origin master

另外一种方法就是先指定本地master到远程的master,然后再去pull:

1 git branch --set-upstream-to=origin/master master
2 git pull

这样就不会再出现“There is no tracking information for the current branch”这样的提示了。

posted @ 2023-03-15 14:59  司徒翘臀  阅读(127)  评论(0)    收藏  举报