git分支管理
巴扎黑
巴扎黑 2017-05-02 09:27:45
0
7
747

git分支管理的策略是什么?
我现在只知道网站的稳定版本应该是在master主分支上,然后开发时应该是在dev分支上做开发。
我现在的问题是:
我在我本地上用git创建了一个分支,然后准备执行pull操作,但是git说“fatal: Couldn't find remote ref dev”。
我现在应该怎么做呢?谁能解答一下。尽量详细一下,不胜感激!

巴扎黑
巴扎黑

reply all(7)
给我你的怀抱
git pull --rebase origin master
大家讲道理

The branch you created locally does not exist in the remote library, so you will get an error. You can try to push it first to synchronize the local branch to the remote origin

刘奇
git branch -r

You can check the remote branch name
Maybe there is no branch called dev on the remote end
Or try

git pull origin dev

Only if the branch exists remotely, you can pull

If the branch does not exist remotely, you can directly

git push origin 分支名

You can push the local branch to the remote end

洪涛

When you create a new branch and switch to the dev branch, the code in the workspace is already the same as the master branch, and there is no need to pull it up remotely.
You can develop on the dev branch now. After development, you can push it to the remote dev or merge it into the master.

洪涛

I’ll give you an article by Ruan Yifeng, which explains the scenes and strategies of branch management in simple terms

http://www.ruanyifeng.com/blog/2012/07/git.html

phpcn_u1582

fatal: Couldn't find remote ref master or fatal: 'origin' does not
appear to be a git repository and fatal: Could not read from remote
repository.
You need to re-enter $ git remote add origingit@github.com :djqiang/gitdemo.git

巴扎黑

1. When faced with more complex projects, git novices can refer to git flow to understand the meaning of master, develop, feather, fix and other branches and their merge order when submitting.
2. Your branch is only created in the local warehouse and has not been pushed to the remote warehouse. "fatal: Couldn't find remote ref dev", this error is that you chose to submit to local and remote at the same time.
3. If you are not familiar with git commands, you can use SourceTree.

Those who transfer from SVN must first understand the distributed version control idea of ​​git. This is the power of git. Once you use it, you will know how cool it is.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template