What is the strategy for git branch management?
I only know that the stable version of the website should be on the master branch, and then development should be done on the dev branch.
My current problem is:
I created a branch using git locally, and then prepared to perform the pull operation, but git said "fatal: Couldn't find remote ref dev".
What should I do now? Can anyone answer this. Please be as detailed as possible, thank you very much!
大家讲道理2017-05-02 09:29:45
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
怪我咯2017-05-02 09:29:45
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
PHP中文网2017-05-02 09:29:45
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.
PHP中文网2017-05-02 09:29:45
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_u15822017-05-02 09:29:45
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
巴扎黑2017-05-02 09:29:45
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.