git-remote

Difference between git remote add and git clone

ぐ巨炮叔叔 提交于 2019-11-28 14:35:50
问题 What does the clone command do? Is there any equivalent to it in svn? What is the difference between git remote add test git://github.com/user/test.git And git clone git://github.com/user/test.git Does the name of the created repo matter? 回答1: git remote add just creates an entry in your git config that specifies a name for a particular URL. You must have an existing git repo to use this. git clone creates a new git repository by copying an existing one located at the URI you specify. 回答2:

Understanding .git/config's 'remote' and 'branch' sections

萝らか妹 提交于 2019-11-28 09:27:00
Here's the contents of the remote and branch sections of my .git/config file. [remote "origin"] url = https://EvanAad@bitbucket.org/EvanAad/bitbucketstationlocations.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master What is the meaning and purpose of the contents of these sections, in particular the fetch and merge subsections? How is this information used by Git to guide its operation? CodeWizard Its called refspec. Its the mechmism that git is using to "talk" to the remote server and to map local branches to remote branches. Refspecs

How do I move my remote git repo to another remote git repo?

萝らか妹 提交于 2019-11-28 07:39:21
I want to move my remote git repository and all its branches to a new remote repository. old remote = git@github.com:thunderrabbit/thunderrabbit.github.com.git new remote = git@newhub.example.net:tr/tr.newrepo.git So what none of these other answers explains too well is that if you want to move all of your remote repository's branches to a new remote using Git's push mechanism, then you need local branch versions of each of your remote's branches. You can use git branch to create local branches. That will create a branch reference under your .git/refs/heads/ directory, where all of your local

Can I create a new repository out of an existing repository but rename it?

放肆的年华 提交于 2019-11-28 06:47:43
问题 I have created a new project locally and it is a template application that has some base code (for upcoming projects), and I pushed it to a remote repository on Github. And all is working fine. I am trying to create new projects (with their own local and remote repositories) out of that template app. For example, say the current project is called TemplateApp. I want to build a new project (based on TemplateApp) but is called CoffeeMaker (name should both be locally called and remotely). How

Failing to push to Github (this exceeds GitHub's file size limit)

醉酒当歌 提交于 2019-11-28 03:57:04
问题 My local branch is not uploading to master because, as the error output states, "downloads/ue4-test-8.zip is 363.08 MB; this exceeds GitHub's file size limit of 100.00 MB" I already removed this file and yet any commits I make get rejected. I've removed the large file. I thought everything would be fine so I added new files to the respiratory Now I get error when going to push about a file that doesn't exist How can I resolve this problem and get back to pushing this repo? Here is my output

How can I push a local Git branch to a remote with a different name easily?

独自空忆成欢 提交于 2019-11-28 02:39:12
I've been wondering if there's an easy way to push and pull a local branch with a remote branch with a different name without always specifying both names. For example: $ git clone myrepo.git $ git checkout -b newb $ ... $ git commit -m "Some change" $ git push origin newb:remote_branch_name Now if someone updates remote_branch_name, I can: $ git pull And everything is merged / fast-forwarded. However, if I make changes in my local "newb", I can't: $ git push Instead, I have to: % git push origin newb:remote_branch_name Seems a little silly. If git-pull uses git-config branch.newb.merge to

Why can't git resolve the hostname when I push to a valid SSH address?

那年仲夏 提交于 2019-11-28 00:59:37
问题 I am deploying an app on Heroku so I created a Heroku app from a repo and then did git push heroku master . When I do this it keeps giving me the error: ! Your key with fingerprint xxx is not authorized to access heroku-app. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. I tried various things with changing my SSH keys including deleting them all and creating new ones. Still it gives me the same error. I have added

List all local branches without a remote

我的未来我决定 提交于 2019-11-27 17:26:02
Problem: I want a way of deleting all the local branches I have that do not have a remote. It's easy enough to pipe the names of the branches into a git branch -D {branch_name} , but how do I get that list in the first place? For example: I create a new branch with no remote: $ git co -b no_upstream I list all my branches, there's only 1 with a remote $ git branch -a master * no_upstream remotes/origin/HEAD -> origin/master remotes/origin/master What command can I run to get no_upstream as an answer? I can run git rev-parse --abbrev-ref --symbolic-full-name @{u} and that will show that it has

git push to remote repository “Could not read from remote repository”

偶尔善良 提交于 2019-11-27 13:53:46
I searched for a while but I can't find a solution to my Problem. I have a Server I can connect to via ssh with the username git and a local git repository. Now I want to push my local repository to a newly created one on the Server. Here is what I did: created a git repository in /home/git/test.git initialized the repository as bare added the remote repository on the local machine git remote add test ssh://git@serverIp:/home/git/test.git now I executed the push command: git push test master I always get the fatal: could not read from remote repository Please make sure you have the correct

fatal: does not appear to be a git repository

最后都变了- 提交于 2019-11-27 11:17:19
Why am I getting this error when my git repository url is correct? EDIT: fatal: 'git@skarp.beanstalkapp.com/gittest.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly You've got the syntax for the scp -style way of specifying a repository slightly wrong - it has to be: [user@]host.xz:path/to/repo.git/ ... as you can see in the git clone documentation. You should use instead the URL: git@skarp.beanstalkapp.com:/gittest.git i.e. in the URL you're using, you missed out the : (colon) To update the URL for origin you could do: git remote set-url origin git@skarp