git-remote

git: disable automatic pushing to a certain remote branch

跟風遠走 提交于 2019-12-05 01:57:48
When I run git push , my local branch some_branch is pushed to a remote branch some_remote\some_branch . When I run git remote show some_remote I get: Local refs configured for 'git push': [cut] some_branch pushes to some_branch I don't want this. How do I remove this entry? Perhaps the simplest answer is to rename your local branch some_branch to another name, e.g. with: git branch -m some_branch a_branch_name_not_present_on_some_remote The reason for this is that git push by default pushes each branch to a branch with a matching name on the remote, if such a branch exists there. If you don't

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

不羁的心 提交于 2019-12-05 01:38:27
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/serverfix. Switched to a new branch "sf" My understanding is that this presents a way to create a local

Cleaning remote Git branches

不问归期 提交于 2019-12-04 15:40:21
I have moved an SVN repo to Git and probably due to a number of clonings, I'm now left with a bunch of branches that look like BranchA origin/BranchA remotes/BranchA remotes/origin/BranchA remotes/origin/origin/BranchA i.e. the same branch is listed a number of times. How can I clean this mess up. There are > 50 branches, some are not needed at all, and for the rest I'd be happy with just having them once. EDIT: This is what git remote show origin looks like for a certain case: Remote branches: BranchA tracked origin/BranchA tracked ... Local branches configured for 'git pull': origin/BranchA

Why is old name of git remote sill in .git/refs/remotes?

痞子三分冷 提交于 2019-12-04 15:21:22
I recently moved my 'main' remote git repository from code.google to github . Then, I renamed old origin repo to code-google and previously created remote github to origin . So far so good. But... There are still references in .git/refs/remotes : code-google github origin I tried this, but it does not seem to be working: $ git remote prune github --dry-run fatal: 'github' does not appear to be a git repository fatal: The remote end hung up unexpectedly Why is github still there since it was renamed? Why am I not able to dispose of it? And how can I clean up my repo? This thread mentions that

Caused by: java.lang.ClassNotFoundException: com.jcraft.jsch.JSchException

拜拜、爱过 提交于 2019-12-04 11:02:11
The protocol between local repository and remote repository is HTTPS instead of ssh,does it still need lib of jsch,and if it's true, can you tell me how to handle in details,thanks so much~~ Even if it isn't used for https access, jsch is still required for JGit. See JGit dependencies . That thread states the same thing , even when cloning an https repo. This blog post deals with a missing jsch library like so: There are 2 ways to solve this problem, depending on your setup. 1.) If you're using ant installed on your machine, example on c:\apache-ant. Just place the jsch.jar in it's lib folder.

git delete remotes: remote refs do not exist

孤街浪徒 提交于 2019-12-04 07:29:32
问题 In short; How can I delete remote multiple merged remotes? More background; I have a git repo with tens of remotes which have been merged into master. I can delete these remotes one at a time by using: git push --delete origin myBranch-1234 However this is a slow and tedious process for all remotes. So I'm trying this command: git branch -r --merged | grep origin | grep -v master | xargs git push origin --delete git branch -r --merged lists all merged remotes. grep origin tells the command to

Changing the Git remote 'push to' default

こ雲淡風輕ζ 提交于 2019-12-03 18:18:20
问题 I want to change the Git default remote branch destination so I could just git push Instead of: git push upstream Currently this is set to the origin remote and I want to set it to a different remote. I tried to remove the original (cloned from) remote git remote rm origin Which did remove the original remote. But doesn't solve the git push problem. I still get: fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository using... I also

git remote prune origin does not delete the local branch even if its upstream remote branch is deleted

主宰稳场 提交于 2019-12-03 17:24:42
问题 This is a common use-case for me, I clone a repository, checkout a branch, do some code changes, make multiple commits, then when its stable, i do a push to remote, eventually the branch gets merged and deleted. and I'm left with a local branch with upstream gone. I was looking for a safe way of deleting all such branches. from the description, it seemed like git remote prune origin is doing this exactly. But it doesn't seem to be working for me. Seeing the following behaviour, the branch

How do I change a commit message after a 'git-pull' auto-merge?

 ̄綄美尐妖づ 提交于 2019-12-03 16:33:51
Occasionally, my collaborators will "panic" when there is an automatic merge generated as the result a git-pull , and just accept the default commit message. Before this commit gets pushed, I want to be sure the message gets fixed, but --amend seems not to work. What is the best way to fix the message that's generated in this scenario. The best instructions I can come up with for them are git reset --soft HEAD~ git merge -m <message> <the tracked remote branch> but that seems a bit scary ( reset ) and error prone (the remote tracked branch has to be entered explicitly). Is there a simple way

Is there any reason to not set 'git fetch' to always use the --prune option?

若如初见. 提交于 2019-12-03 16:32:01
问题 Using git fetch --prune deletes local remote tracking branches when the branch on the remote machine has been deleted. Setting remote.origin.prune to true using the following... git config --global fetch.prune true ...makes using the fetch command always implicitly use the --prune option. I am putting together a best-practices/introduction to git for some developers in my group who aren't quite familiar with it. I want to be sure I know this is not a dangerous behavior before advising them to