git-remote

git fetch with path instead of remote

时光总嘲笑我的痴心妄想 提交于 2020-01-14 10:13:52
问题 I understand the idea of running git fetch <remote> , because the remote branches are then available with git checkout <remote>/<branch> . But how does it work if I just run git fetch path/to/other/repo How can I checkout the corresponding branches? Note that the operation runs silently (even with --verbose ), and that no new branch is created. edit : just to be clear: I perfectly understand how git works with remotes. I'm just curious about this alternate syntax git fetch path/to/remote , or

Join old and new repo, created by copying files (not cloning), preserving commit history

五迷三道 提交于 2020-01-06 20:16:51
问题 To simplify things I have the following structure in git old_repo for "subpath": subpath/old_commit_1 subpath/old_commit_2 subpath/old_commit_latest I decided to move to a new_repo and just copied the latest version of "subpath" (from old_commit_latest) into it without any commit history. So the new_repo now has "subpath" and a bunch of new commits I made to it: subpath/new_commit_subpath_added # added subpath here subpath/new_commit_1 subpath/new_commit_2 subpath/new_commit_latest Now I need

where are project files in remote repo in Git?

谁都会走 提交于 2020-01-05 06:54:28
问题 I start to use Git and my project VCS. I have created a remote repo using git init --bare in /codes-repo and push changes from local repo to there. then I want to move project files from there to /var/www/project to be accessible for http://.... . but I don't see any project files (index.php,css/,....) at /codes-repo to copy them, there are only git files and folders there. Where are them?? 回答1: A bare repository does not have a checkout. That is to say, a bare repository only holds the

New git repository error on first push

ぐ巨炮叔叔 提交于 2020-01-04 05:34:44
问题 I did git init , then I realized I should include the link that I got when I made the repository in GitHub so I did this: git init https://github.com/genadinik/AndroidMakeMoneyFree.git Then I did: git add -all git commit -m "Adding repository contents" And that worked fine, but then I tried to push and got this error: git push origin master fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights

git: disable automatic pushing to a certain remote branch

梦想的初衷 提交于 2020-01-02 01:39:05
问题 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? 回答1: 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

List all local branches without a remote

二次信任 提交于 2019-12-28 04:45:10
问题 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 without a remote: $ git co -b no_upstream I list all my branches, and there's only one 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

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

会有一股神秘感。 提交于 2019-12-28 04:00:08
问题 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

Git : Could not read from remote repository

半腔热情 提交于 2019-12-25 01:53:15
问题 I'm trying to set a bare remote git repository on my ovh server. When I'm trying to push, I get the following error : fatal: '/git/repo.git' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. I've tried everything so far and that include every post on stackoverflow I've set a private/public key. It does not seem to be the problem. If I try with an invalid key, the message is not

Deleting or undoing a push to a remote Git repo

ε祈祈猫儿з 提交于 2019-12-24 19:03:52
问题 I created a remote git repository and proceeded to push code to it from the wrong local repo. The local repo is fine I just want to remove the content I pushed to the remote and start over. I have tried git push origin :master but got an error: ! [remote rejected] master (branch is currently checked out) error: failed to push some refs to 'ssh://................. Is there a simple way of checking it in? 'check in' or 'checking in' (and other variations) produce no relevant results. 回答1:

Preserve git remotes

别说谁变了你拦得住时间么 提交于 2019-12-23 07:31:19
问题 I have fixed network of git remotes and I would like them to be attached to repository. Unfortunately git-clone doesn't clone remotes. Is there a way around it? 回答1: I begin this command https://github.com/juanpabloaj/git-remote-init for save the remotes in a .gitremotes file 回答2: There is no way to do this with git, as far as I know. Telling users to run scripts post-clone is what people tend to do. If it's a ruby project, you probably have rake , for example, so you could have a rake post