branch

What is the difference between pull and clone in git?

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the difference between doing (after mkdir repo and cd repo ): git init git remote add origin git://github.com/cmcculloh/repo.git git fetch --all git pull origin master and git clone git://github.com/cmcculloh/repo.git I mean, obviously one is shorter, but other than that are they basically doing the same thing? 回答1: They're basically the same, except clone will setup additional remote tracking branches, not just master. Check out the man page : Clones a repository into a newly created directory, creates remote-tracking branches for

In git, what is the difference between merge --squash and rebase?

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to git and I'm trying to understand the difference between a squash and a rebase. As I understand it you perform a squash when doing a rebase. 回答1: Both git merge --squash and git rebase --interactive can produce a "squashed" commit. But they serve different purposes. git merge --squash abranch will produce a squashed commit on the destination branch, without marking any merge relationship. (Note: it does not produce a commit right away: you need an additional git commit -m "squash branch" ) This is useful if you want to throw away

git error: failed to push some refs to

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: For some reason, I can't push now, whereas I could do it yesterday. Maybe I messed up with configs or something. This is what happens: When I use the git push origin master What my working directory and remote repository looks like: 回答1: If the GitHub repo has seen new commits pushed to it, while you were working locally, I would advise using: git pull --rebase git push The full syntax is: git pull --rebase origin master git push origin master That way, you would replay (the --rebase part) your local commits on top of the newly updated

mysql select distinct query in PHP

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: $sql = "SELECT DISTINCT Branch FROM student_main" ; $result = mysql_query ( $sql ); $row_num = mysql_num_rows ( $result ); $rows = mysql_fetch_array ( $result ); echo "<select name='Branch'>" ; for ( $i = 0 ; $i <= $row_num - 1 ; $i ++){ echo "<option value='" . $rows [ $i ]. "'>" . $rows [ $i ]. "</option>" ; } echo "</select>" ; echo "<input type='submit' Value='submit' />" ; echo "</form>" ; I am trying to create a dropdown using the above code for my form. But its not working. There are 3 distinct values in the Branch column

Is there an easy way to change to previously active branch?

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using git (in fact, msysgit) 1.6.4 on Windows. Most of the time I'm doing work in some feature branches. Every now and then, I want to hop back to master to cherry-pick one particular commit I did in my feature branch - usually because it's a useful bugfix which makes sense even without the feature. My workflow is like this - if this is unnecessarily complicated, please tell me :-) : git checkout - b mycoolfeaturebranch // hack away, implementing a feature and one bugfix (while I'm at it) git add file_with_bugfix . cpp git

Pushing a large github repo fails with “unable to push to unqualified destination: master”

匿名 (未验证) 提交于 2019-12-03 01:19:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a large git repo (created from an SVN repo) and I want to push it to github. Given it's large, I can't just try and push it directly, as it fails with a "pack too large" error. All good so far, I can push the repo one commit at a time. But when I try to do this what happens is: git push origin 86c310d8a680d6d0e052fa7db89adb25348f3e54:master error: unable to push to unqualified destination: master The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on

Pushing a large github repo fails with “unable to push to unqualified destination: master”

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a large git repo (created from an SVN repo) and I want to push it to github. Given it's large, I can't just try and push it directly, as it fails with a "pack too large" error. All good so far, I can push the repo one commit at a time. But when I try to do this what happens is: git push origin 86c310d8a680d6d0e052fa7db89adb25348f3e54:master error: unable to push to unqualified destination: master The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on

Git Merge commits into an orphan branch

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm curious to know if you CAN and if there is anything wrong with merging commits INTO my orphan branch. For this specific instance my Salesforce repository has a master branch and a pre-release branch but because our sandbox environment often has metadata that is not part of production yet we want to version control it but separate enough from our clean pre-release branch. So as it is we have the following: (Production Init Commit) (official release) / / o-------------------------o [master] \ / o------o---------o----o [pre-release] \ / o--

Can I tell git pull to overwrite instead of merge?

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: As far as I see, git pull someRemote master tries to merge the remote branch into mine. Is there a way to say "Completely discard my stuff, just make me another clone of the remote" using git pull? I still want to keep my own repository and keep it's history, but I want to have a 1:1 copy of someRemote's master branch after that command. To clarify, imagine there are 2 repositories, RM and MY. Numbers are commits, and this assumes only one branch (master). RM1 --- RM2 --- RM3 --- RM4 --- RM5 --- RM6 ... | | +-> MY1 --- MY2 --- MY3 -+-> MY4 -

git refname &#039;origin/master&#039; is ambiguous

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a git repository that is tracking several remote branches: $ git branch -a * master remotes/git-svn remotes/origin/master remotes/trunk When I try to setup a default one I get the following error: $ git branch --set-upstream-to=origin/master master warning: refname 'origin/master' is ambiguous. fatal: Ambiguous object name: 'origin/master'. I would like to kremove some of the remote master branches but the master references are still there. How can I remove them to be able to set the default upstream branch to origin/master ? $ git