git-remote

Bare and non-bare repo at the server

拜拜、爱过 提交于 2019-12-13 17:42:49
问题 I want to track directories and files stored at the server. The initial idea was to set up a bare repository at the server and then push/pull from local machines (where non-bare repos are stored). The problem is that updated files must be present at the server. Initially I focused on setting up a non-bare repo on the server and pulling from the bare repo but it would require someone to git pull every time a push is made from a local machine. My question is: is it possible to set up bare and

Retrieve missing files from remote repo?

风格不统一 提交于 2019-12-13 12:01:16
问题 I accidentally deleted a few files from my local git repo. I have not pushed this change to the remote. Is there a easy way to get these files back from the remote? Normally I would just do a git clone but it seems there should be a better way. 回答1: git checkout . How do I discard unstaged changes in Git? 回答2: You should just be able to either revert the commit with the deletions, or reset HEAD to the commit before you did the deletes, depending on whether you want to keep the deletions in

What should remotes/origin/HEAD set to?

柔情痞子 提交于 2019-12-13 10:16:13
问题 If the developers are working on develop branch, for a new project 1) Clone git clone <git_url> should be able to automatically clone develop branch locally without using -b option, so that $ git branch -a # after clone should give * develop remotes/origin/HEAD -> origin/develop remotes/origin/develop 2) Push When developer pushes local branch( develop ) changes to remote repository( origin/develop ) using command git push origin develop , my understanding is, changes are pushed to origin

“Changes not staged for commit" even after git commit -am b/c origin has a file with de-capitalize filename

廉价感情. 提交于 2019-12-13 10:09:50
问题 Problem: two files under two different name-cases in the same directory, which I didn't know at the first. So I was quite surprised to see this, git commit -am "why" On branch tmp Changes not staged for commit: modified: src/view/callCenter/seatReport/SeatSubstate.vue Then I found origin has both SeatSubstate.vue & seatSubstate.vue in the path src/view/callCenter/seatReport But on my mac ls src/view/callCenter/seatReport/ ... seatSubstate.vue /* did NOT show SeatSubstate.vue only seatSubstate

How do I restore a remote crashed Git repo?

冷暖自知 提交于 2019-12-13 03:59:31
问题 Okay. We all know that every clone of a repo is good as a backup of the cloned repo. Fine. Also, every remote whose history gets updated with git fetch is backed up in that repo where git fetch was applied. But when it comes to restore of the backup: how do I do it? What is the right opposite command of git fetch ? One of my Git repo has issues: git status fatal: unable to read tree 0d2f806b01ded93e76a6f2c7a68429939f483026 Yes, I could start repairing the repo somehow, but – lucky me – I did

GIT push not pushing commits to remote

岁酱吖の 提交于 2019-12-12 16:08:34
问题 I have been working on a git repository and have been pushing my local changes to a remote server all the time... up until recently. When I do a git push, it says that everything is up-to-date. In reality, I'm already 3 commits ahead of the remote version and it's not getting my changes. I have tried the git log -1, git reset --hard solution posted on various places, but that doesn't solve anything. Do I need to change that number to reflect the number of commits that I am ahead? Say I have 5

How to set up a git development environment when you're testing remotely

我的梦境 提交于 2019-12-12 12:39:54
问题 This may seem like a silly question, but I feel like I understand GIT fairly well, and yet I can't seem to set up my development environment as I would like. I'm either missing something really simple, or I'm going about it all wrong :) I initialized a bare git repo on my server, cloned it to my local machine, committed my files and pushed to origin. Then, locally I created three branches (master, release, develop) and published them all to origin. I intend to have multiple developers pulling

Remote Pushurl won't work

懵懂的女人 提交于 2019-12-12 09:51:47
问题 I'm using GIT for my projects. Now I want to integrate it with github, so I created a remote: git remote add github https://WouterJ@github.com/WouterJ/project.git But now I need to fill in a password for fetching, something that I don't want. So I decided to use a different url for fetching: git remote set-url github http://github.com/WouterJ/project.git git remote set-url --push github https://WouterJ@github.com/WouterJ/project.git If I run git remote -v I get this: $ git remote -v github

git branch -r vs git remote show origin

﹥>﹥吖頭↗ 提交于 2019-12-11 20:02:48
问题 So I was looking for a way to see a list of all the branches that exist on the remote, and found the following 2 commands: 1. git branch -r 2. git remote show origin Whats the difference between the 2 commands? 回答1: The git branch command looks at (or, invoked differently, modifies) your own repository's information. For remote-tracking branches ( git branch -r ), this shows what's in your cached copy of what was on the remotes the last time you had your git contact those remotes and get

GIT isn't fetching my new branch

戏子无情 提交于 2019-12-11 13:10:52
问题 I have created a new branch on my remote, so I would expect to do this: $ git fetch && git checkout feature/name However, I get this error: error: pathspec 'feature/name' did not match any file(s) known to git. When I run git fetch on its own, it doesn't return anything, I have also tried git fetch origin which does not work either. git remote returns just the one remote called origin . My config looks like this: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates