git-remote

Git pushing into master failed…

不羁岁月 提交于 2019-12-11 11:52:03
问题 I am not sure where to search from as the error list is as long as the bottom. But generally this is what I did. What I did: git clone url . git add abc.txt git commit -m "testing" git push origin master / git push Error: remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branch in a non-bare repository remote: error: is denied, because it will make the index and work tree inconsistent remote: error: with what you pushed,

git branch unkown but checkout works

时光总嘲笑我的痴心妄想 提交于 2019-12-11 07:58:39
问题 on my remote repository a new branch has been created. In GitBash in my Working Directory (on master branch) I type git remote update and git pull . To my understanding git remote update will update all branches set to track remote ones as explained here: What is the difference between 'git remote update', 'git fetch' and 'git pull'? So when I type git diff master newBranch --name-only I expected to see a list of files which are different in both branches. But instead I got the following

How does git deal with identical branch names from two different remote repo?

China☆狼群 提交于 2019-12-11 03:49:45
问题 If I set up two remote using git remote add for a repo, and the two repo contain a branch with the same name. How does git know which branch of which repo I intend to use when I switch to it using git checkout ? 回答1: How does git know which branch of which repo I intend to use when I switch to it using git checkout? It doesn't. Typically, if there is ambiguity, such as in this situation where both remotes ("origin" and "upstream2") have a devel branch: $ git branch -a * master remotes/origin

git clone does not checkout active branch

北城以北 提交于 2019-12-10 21:32:45
问题 I have a remote bare repository with two branches 'master' and 'testing', where HEAD refers to 'testing'. When cloning this repository git checks out 'master', if 'master' and 'testing' are on the same revision (i.e. HEAD == testing == master). Only if 'testing' is one (or more) commit(s) behind or ahead, git clone checks out the 'testing' branch on the local side. I tried this with git 1.7.5 on Mac OS X (10.6.8). Addendum: I just tried the same with a non-bare repository: mkdir A cd A git

Can not create a local and remote branch (tracking) at the same time

房东的猫 提交于 2019-12-10 01:21:28
问题 From Pro Git: you can set up other tracking branches if you wish — ones that don’t track branches on origin and don’t track the master branch. The simple case is the example you just saw, running git checkout -b [branch] [remotename]/[branch] $ git checkout --track origin/serverfix Branch serverfix set up to track remote branch refs/remotes/origin/serverfix. Switched to a new branch "serverfix" $ git checkout -b sf origin/serverfix Branch sf set up to track remote branch refs/remotes/origin

How to set a git branch to push to a remote with a different branch name and pull from completely different url

风流意气都作罢 提交于 2019-12-09 10:58:32
问题 My local git repo needs to pull from one server. It then needs to push a specific branch to a review repo with a different branch name on a different server. Something like: Pull everything from PullOnlyRepo on Server1 (we'll call that origin maybe?) Push Branch hotfix to ReivewRepo with branch name JistChanges on Server2. Right now git config -l shows: remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* remote.origin.url=<URL for Server1> remote.origin.pushurl=no_push (this shouldn't

Critical situation in removing a local branch

喜夏-厌秋 提交于 2019-12-08 19:28:48
问题 I using the following command to remove a local branch with force delete option: $ git branch -D <branch_name> My question is, If I delete a local branch that had an upstream set and then do a normal push, it won't delete the remote branch right? What should I do in this situation? [ NOTE ]: "-D" is force delete option. I want delete the local branch and keep the remote branch in origin. 回答1: git will only delete your local branch, please keep in mind that local and remote branches actually

How to setup multiple tracking levels of branchs with git

谁说胖子不能爱 提交于 2019-12-08 12:41:50
问题 I have a git local branch that tracked the remote svn trunk. I created a new development branch and set the local branch to track it. I want that the development branch will also track the svn/trunk something like: from: local branch > development branch to: local branch > development branch > svn/trunk Is it possible to do it with git? I'm using git version 2.14.3 git GUI - smartgit v18.1 回答1: No, this is not possible in Git. But it's also not that important (really!), because tracking a

how to request pull request from a particular remote in git?

本秂侑毒 提交于 2019-12-08 09:48:38
问题 This is how my config file of git looks: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = false [remote "origin"] url = git@github.com:XXXXXXX/training.test.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [remote "upstream"] url = https://github.com/YYYYYYY/training.test.git fetch = +refs/heads/*:refs/remotes/upstream/* The remote "origin" points to my

git - browse remote repos

老子叫甜甜 提交于 2019-12-08 07:27:12
问题 Is it possible to browse all the remote repos available on a given server? I've seen this: Git - Browse remote repository which is about browsing branches in a remote repo. However, I'm assuming this is more of an ssh scripting solution as you need to be able to ssh to the machine and list all the git repos in a certain directory. 回答1: No, git alone would not offer that kind of feature. If you have an intermediate layer between the listener (ssh) and your repo, like gitolite , then you can