git-bare

Getting a working copy of a bare repository

余生颓废 提交于 2019-11-28 06:48:28
I have a server on which I have a bare repository for pushing. However, my server needs to have a working copy of the master branch. How do I get a working copy and that only from a bare repository? You can simply clone the repository to another directory on the same machine: git clone /bare/repo/dir.git The current directory will become a non-bare clone of your repo, and you'll get a checkout of the master branch automatically. Then use the usual commands like git pull to update it as needed. As a side benefit, this operation is very efficient — if you specify a local directory to git clone ,

How can I uncommit the last commit in a git bare repository?

若如初见. 提交于 2019-11-27 10:22:15
Taking into consideration that there are several git commands that make no sense in a bare repository (because bare repositories don't use indexes and do not have a working directory), git reset --hard HEAD^ is not a solution to uncommit the last change in such a repository. Searching through the Internet, all I could find related to the topic is this , in which I am presented three ways of doing this: 1. "update the ref manually (which involves plumbing)"; 2. " git push -f from a non-bare repository"; 3. " git branch -f this $that ". Which solution do yo think is more appropriate or what

“fetch --all” in a git bare repository doesn't synchronize local branches to the remote ones

烈酒焚心 提交于 2019-11-27 04:26:37
I'm trying to synchronize periodically a git bare repository, my local branches are created using the "--track" option. here is my config (without unnecessary things): [core] bare = true [remote "origin"] url = git@github.com:Ummon/D-LAN.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [branch "website"] remote = origin merge = refs/heads/website I must use the 'cp' command to update the local branches: git fetch --all cp -r refs/remotes/origin/* refs/heads Is there a more elegant solution? sehe Instead of copying the ref files around

What is a bare repository and why would I need one?

烂漫一生 提交于 2019-11-26 22:45:52
This maybe has been answered, but I didn't find a good answer. I come from centralized repositories, such as SVN, where usually you only perform checkouts, updates, commits, reverts, merges and not much more. Git is driving me crazy. There are tons of commands, but the most difficult to understand is why many things work as they do. According to "What is a bare git repository?" : Repositories created with git init --bare are called bare repos. They are structured a bit differently from working directories. First off, they contain no working or checked out copy of your source files. … A bare

“fetch --all” in a git bare repository doesn't synchronize local branches to the remote ones

一个人想着一个人 提交于 2019-11-26 12:44:32
问题 I\'m trying to synchronize periodically a git bare repository, my local branches are created using the \"--track\" option. here is my config (without unnecessary things): [core] bare = true [remote \"origin\"] url = git@github.com:Ummon/D-LAN.git fetch = +refs/heads/*:refs/remotes/origin/* [branch \"master\"] remote = origin merge = refs/heads/master [branch \"website\"] remote = origin merge = refs/heads/website I must use the \'cp\' command to update the local branches: git fetch --all cp

Git submodule on remote bare

给你一囗甜甜゛ 提交于 2019-11-26 12:26:16
问题 I\'ve setup my environment so I can push to a remote bare repository, I used these commands to setup the remote repository: $ mkdir ~/website.git && cd ~/website.git $ git init --bare And $ cat > hooks/post-receive #!/bin/sh GIT_WORK_TREE=/var/www/website git checkout -f $ chmod +x hooks/post-receive And on my local environment: $ git remote add web ssh://website.com/home/website.git $ git push web +master:refs/heads/master Now i can deploy to this remote using git push web and everything

Writing a git post-receive hook to deal with a specific branch

主宰稳场 提交于 2019-11-26 11:03:42
Here's my current hook in a bare repo that lives in the company's server: git push origin master This hooks pushes to Assembla. What i need is to push only one branch (master, ideally) when someone pushes changes to that branch on our server, and ignore pushes to other branches. Is it possible to select the branch from a bare repo and push only that branch to Assembla? A post-receive hook gets its arguments from stdin, in the form <oldrev> <newrev> <refname> . Since these arguments are coming from stdin, not from a command line argument, you need to use read instead of $1 $2 $3 . The post

What is a bare repository and why would I need one?

大兔子大兔子 提交于 2019-11-26 08:26:00
问题 This maybe has been answered, but I didn\'t find a good answer. I come from centralized repositories, such as SVN, where usually you only perform checkouts, updates, commits, reverts, merges and not much more. Git is driving me crazy. There are tons of commands, but the most difficult to understand is why many things work as they do. According to \"What is a bare git repository?\": Repositories created with git init --bare are called bare repos. They are structured a bit differently from

How do I convert a bare git repository into a normal one (in-place)?

大憨熊 提交于 2019-11-26 03:51:32
问题 I have a bare git repository, but need to access and browse its contents over ssh (in a file manager like user experience). I assume I could clone it: git clone -l <path_to_bare_repo> <new_normal_repo> However, my repository is about 20GB in size and I don\'t have the space to duplicate it. Is there a way to convert the bare repository in-place to end up with a working copy in it? 回答1: Note : I tested this on a very simple 1-commit repository. Double-check this, read the man pages, and always

Writing a git post-receive hook to deal with a specific branch

妖精的绣舞 提交于 2019-11-26 03:29:12
问题 Here\'s my current hook in a bare repo that lives in the company\'s server: git push origin master This hooks pushes to Assembla. What i need is to push only one branch (master, ideally) when someone pushes changes to that branch on our server, and ignore pushes to other branches. Is it possible to select the branch from a bare repo and push only that branch to Assembla? 回答1: A post-receive hook gets its arguments from stdin, in the form <oldrev> <newrev> <refname> . Since these arguments are