git-remote

Git: Push a local git submodule, including submodule files, to a remote bare repository

穿精又带淫゛_ 提交于 2019-12-08 03:37:59
问题 I have two local projects which I manage with git , one being dependent on the other – like this: project A/ ├── project B/ │ ├── file B₁ │ ├── file B₂ │ ├── … It makes sense to me to have project B as a git submodule of project A . Now, I have set up a remote bare repository for project A for backup and sharing purposes. Of course, I want the remote repository to contain all of project B , including its files ( file B₁ , file B₂ , …). But git push and git push --recurse-submodules=on-demand

Git: how to change active branch on remote repository?

这一生的挚爱 提交于 2019-12-08 02:05:24
问题 I worked on some code on a local branch and then I pushed it to a remote test repository with this command: git push origin fix_vouchers:fix_vouchers I'd like to change the active branch on that remote repository so that the other developers can test this code. Can I do this from my local environment? 回答1: If the remote repository is just a sharing point, a bare repository, you'd be better off just communicating the branch having the code to the other developers. In a later comment you

Programmatically get remote used for git push

心已入冬 提交于 2019-12-08 01:56:39
问题 How can I obtain the remote used when issuing git push ? I want to be able to use this in a script, or in git alises. Related: Default remote for git fetch 回答1: The answer is not as simple as for fetching, because there is a list of fallbacks which need to be considered: branch.<name>.pushRemote remote.pushDefault branch.<name>.remote origin These aliases take into account all of the above: branch-name = "symbolic-ref --short HEAD" # https://stackoverflow.com/a/19585361/5353461 branch-remote

How to add a remote to a repository with lfs?

本秂侑毒 提交于 2019-12-08 01:32:23
问题 I'm trying to set up something like this: a bare repo on my HDD drive and a clone of it on my SSD with lfs installed. I'm doing it like this: First I set up a bare repo on my HDD: mkdir git_lfs_test.git cd git_lfs_test.git git init --bare And then on my SSD: git clone D:/Git/git_lfs_test.git cd git_lfs_test git lfs install git lfs track '*.png' After doing this I open the cloned repo in GitKraken. I make the initial commit and then commit and push the .gitattributes file. Then I create a png

How can I reject git pushes on an origin repo from a local repo if it does not pass unit tests?

独自空忆成欢 提交于 2019-12-07 12:27:26
问题 I have an origin repo that I have full access to and I don't want code to be pushed successfully to this repo unless the code being pushed successfully passes my unit tests. I saw many examples of .git/hooks/update scripts and they seem to break down into a few categories that do not fit my use case. For example, in (http://git-scm.com/book/en/Customizing-Git-An-Example-Git-Enforced-Policy), the script accesses files locally in the .git/hooks/ directory (ACL example) or individual files in

Git - Can't Push - “! [remote rejected] master -> master (Working directory has unstaged changes)”

孤者浪人 提交于 2019-12-07 06:13:27
问题 I am trying to set up a "simple" git workflow for a Wordpress installation that has a local version, a staging version and a production version. All I want to do is make changes locally and push from local to staging and from local to production. At first I thought this would be a simple task. I have been able to initialize the repository, add the two remotes "staging" and "production", initialize git on the remotes and push changes from my local version to the staging and production servers

How to delete files from git bare remote repository?

淺唱寂寞╮ 提交于 2019-12-07 02:13:13
问题 I have a remote bare git repository. A new developer cloned it, but he didn't have a properly configured .gitignore file, so he mistakenly pushed some unwanted files into the remote. When I pulled the changes and merged, I got these previously untracked files. Others have also pulled the changes from the remote and have these unwanted files as well. How do I delete these files from the remote repository, and everyone else's remote/origin/branches? 回答1: This is a three step process: Remove the

Does JGit API have all Git commands

こ雲淡風輕ζ 提交于 2019-12-06 15:08:06
I am trying to port a shell script to Java which contains a few Git commands which I have mostly managed to find in the JGit API. I have not, however, managed to find the remote or am commands, is this because the don't exist or I am just looking in the wrong place for them. If they don't exist is there another way to use them? There is no ready-to run counterpart for git remote and am in JGit, but it should be possible to implement (a subset of) them with reasonable effort. Those sub-commands of git remote that query or manipulate the config file can be emulated by directly accessing the

git - browse remote repos

百般思念 提交于 2019-12-06 14:48:58
Is it possible to browse all the remote repos available on a given server? I've seen this: Git - Browse remote repository which is about browsing branches in a remote repo. However, I'm assuming this is more of an ssh scripting solution as you need to be able to ssh to the machine and list all the git repos in a certain directory. No, git alone would not offer that kind of feature. If you have an intermediate layer between the listener (ssh) and your repo, like gitolite , then you can call special gitolite commands in order to get all the repos available (that you are authorized to see). For

Git: how to change active branch on remote repository?

帅比萌擦擦* 提交于 2019-12-06 14:33:23
I worked on some code on a local branch and then I pushed it to a remote test repository with this command: git push origin fix_vouchers:fix_vouchers I'd like to change the active branch on that remote repository so that the other developers can test this code. Can I do this from my local environment? If the remote repository is just a sharing point, a bare repository, you'd be better off just communicating the branch having the code to the other developers. In a later comment you however imply that the remote repository is a checkout served as a website. You should note that even if you