branch

学习git指令

匿名 (未验证) 提交于 2019-12-02 23:38:02
Git修改远程仓库地址:      git remote set-url origin 远程地址      Git查看状态      git status      1. 查看远程和本地所有分支      git branch -a         2. 查看本地分支      git branch        3. 切换分支命令    git checkout -b v1 origin/v1 切换回master git checkout master 出现这种问题的原因是因为在新建分支的时候 本地分支 没有与远程分支建立联系   If you wish to set tracking information for this branch you can do so with:         按照提示 输入如下命令    git branch --set-upstream-to=origin/dev dev 如何去解决fatal: refusing to merge unrelated histories 1.git checkout master #切换到要提交代码的分支 2.git pull origin master --allow-unrelated-histories #加上后面这个选项允许不相关历史提交 3.git push origin master

Git遇到错误时如何解决的一些坑

匿名 (未验证) 提交于 2019-12-02 23:36:01
1 git pull遇到错误:error:Your local changes to the following files would be overwritten by merge: 方法1:如果你想保留刚才本地修改的代码,并把git服务器上的代码pull到本地(本地刚才修改的代码会被暂时封存起来) git stash git pull origin master git stash pop 如此一来,服务器上的代码更新到了本地,而且你本地修改的代码也没有被覆盖,之后使用add,commit,push命令即可更新本地代码到服务器了。 方法2:如果你想完全地覆盖本地的代码,只保留服务器端代码,则直接回退到上一个版本,再进行pull: git reset -- hard git pull origin master 2 在git push origin master时出现以下这个问题时: error : failed to push some refs to 'git@github.com:yangchao0718/cocos2d.git hint: Updates were rejected because the tip of your current branch is behin hint: its remote counterpart. Integrate the

Perforce, How to integrate a change to another branch?

ⅰ亾dé卋堺 提交于 2019-12-02 22:57:48
I have trunk and a release branch. If I fixed a bug in release branch, I definitely should integrate the fix back to trunk. However, I didn't find a command dedicated to integrate such a single change list; did I miss something? To integrate changelist 100, for example, you'd use: p4 merge //releasebranch/...@=100 //trunk/... p4 resolve p4 submit (If you have an older Perforce server you'll have to use 'integ' instead of 'merge'.) Note that '@=100' means the same thing as '@100,100' in this context. 来源: https://stackoverflow.com/questions/12106321/perforce-how-to-integrate-a-change-to-another

git rebase branch with all subbranches

浪子不回头ぞ 提交于 2019-12-02 22:41:15
is it possible to rebase a branch with all it's subbranches in git? i often use branches as quick/mutable tags to mark certain commits. * master * * featureA-finished * * origin/master now i want to rebase -i master onto origin/master , to change/reword the commit featureA-finished^ after git rebase -i --onto origin/master origin/master master , i basically want the history to be: * master * * featureA-finished * (changed/reworded) * origin/master but what i get is: * master * * (same changeset as featureA-finished) * (changed/reworded) | * featureA-finished |.* (original commit i wanted to

Branching and remote heads in Mercurial

删除回忆录丶 提交于 2019-12-02 22:28:09
I created a new branch using this command: hg branch new_branch After the first commit to the new branch, the default branch becomes inactive. If this is pushed the central repository will have only one head which belongs to the new branch. When my colleague pushes his commits on the default branch, he will get this error: pushing to ssh://... searching for changes abort: push creates new remote heads! (did you forget to merge? use push -f to force) Is there anything bad about forcing the push? Why are remote heads bad? How do you work remotely on separate branches and push to one repository?

Prepend Git commit message with partial branch name

别等时光非礼了梦想. 提交于 2019-12-02 22:20:24
My current branch naming convention is as such: ticket-45-my-new-feature-branch-description I am currently using this code in my .git/hooks/prepare-commit-msg file to prepend every commit message with the branch name as such: BRANCH_NAME=$(git branch 2>/dev/null | grep -e ^* | tr -d ' *') if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then echo "[$BRANCH_NAME] $(cat $1)" > $1 fi End result: [ticket-45-my-new-feature-branch-description] test commit What I'm trying to accomplish is output like this: [ticket-45] test commit Brownie points if we can capitalize it: [TICKET-45] test

将本地存储库分支重置为类似于远程存储库HEAD

非 Y 不嫁゛ 提交于 2019-12-02 22:15:43
如何将本地分支重置为与远程存储库中的分支相同? 我做了: git reset --hard HEAD 但是当我运行 git status , On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: java/com/mycompany/TestContacts.java modified: java/com/mycompany/TestParser.java 您能告诉我为什么我要进行这些“修改”吗? 我还没有碰过这些文件? 如果我这样做了,我想删除那些。 #1楼 这是一个脚本,可自动执行最流行的答案所建议的内容...有关支持分支的改进版本,请参见 https://stackoverflow.com/a/13308579/1497139 #!/bin/bash # reset the current repository # WF 2012-10-15 # see https://stackoverflow.com/questions/1628088/how-to-reset-my-local-repository-to-be-just-like-the-remote-repository-head timestamp=`date "+%Y-%m-

Why does git branch -t fail with “Not tracking: ambiguous information”?

大兔子大兔子 提交于 2019-12-02 22:13:10
When I try to create a new branch tracking a remote branch, I get this: $ git branch -t test origin/foo error: Not tracking: ambiguous information for ref refs/remotes/origin/foo The source seems to somehow search for branches to track and throws me out because it finds less more than one, but I don't exactly get what it's looking for since I already told it what to track on the command line. Can anybody tell me what's going on and how to fix it? I saw this also when I had two remote repo's with the same (default) fetch pattern ( fetch = +refs/heads/*:refs/remotes/origin/* ) and the same

CEF3编译添加mp4支持(对应CefSharp63.0.3),chromium63(3239),附release下载

匿名 (未验证) 提交于 2019-12-02 22:10:10
编译环境需求(3239版本) win7或更高,64位 vs2017 15.3.2+ 默认位置安装 不需要安装附带的win10sdk,sdk单独装 Windows 10.0.15063.468 SDK 默认位置安装 下载相应版本sdk 8g ram 和 40g disk 实测 完全不够 ,最终编译成功时是16g内存+32g虚拟内存+110g左右的磁盘空间,据说是因为新版official编译巨耗内存 可以不可描述的互联网 我是用proxfixer配合ss实现全局代理 其他 https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding.md 在这里可以查看不同的branch版本需要的具体环境 WARNING: If you are using VS2017 15.5.* to build 3282 branch then you must add enable_precompiled_headers=false to GN_DEFINES to avoid a known issue with clang. 步骤 使用cmd命令行操作 盘符和路径可改,保证目录结构即可,留足至少100g空间 创建文件夹 c:\code\automate c:\code\chromium_git 下载depot_tools.zip