Using Github & Unfuddle at the same time - repository

Is there a way to use Github and Unfuddle for the same repo? I am responsible for a repo hosted at Unfuddle, but I am not the main owner and it's private because it's part of an ongoing project. I still need to update the repo there when changes are made, but I would like to use the same set of files to create and update a public Github repo associated with my own account, is that possible? The reason I want to use the same files is that it's a WordPress plugin and it needs to be tested before I commit changes, therefore I need to use one set of files to not complicate the matter. Any help would be appreciated.

You can set up both the repositories as remotes and push/pull to and from both of them; Git is decentralized and thus doesn't really care about whether you have one remote or many.
http://www.kernel.org/pub/software/scm/git/docs/git-remote.html
Example:
git remote add github git#github.com:username/reponame.git
and then...
git push github <branchname>
git pull github
git log github/<branchname>
etc...

Create your github repository, then from your Unfuddle local repository, run:
git remote add github git#github.com:YourUsername/YourReponame.git
Where YourUsername is your github user name, and YourRepository is your repository name. After setting up the github repository, the above URL with the user name and repository name filled in, should appear on your github repository page anyway.
Everything works like you'd expect, for example, pushing:
git push github
Your settings for the Unfuddle repository will work like before.

Related

Gerrit submit change to a git submodule

I have a gerrit repo with a submodule:
parent
submodule
Now I make some change to submodule and want to push that to gerrit. Unfortunately the submodule is set up only as a git repo, not a gerrit repo, because gerrit repo has remote url that contains my username, thus cannot be checked into the .gitmodules file. So is there a convenient way to set up the submodule also as a gerrit repo when I clone parent?
So far my colleagues have all told me to patch whatever change in the submodule to a separate gerrit cloned copy of the submodule. But this seems rather inefficient. I see no reason why gerrit remote urls should not be propagated to all the submodules, recursively. Thanks!
I'm not sure if I understood your question correctly, but you don't need to add your username in the repository remote url in the .gitmodules file. Just use something like that:
url=https://GERRIT-SERVER/a/REPO-PATH
When the username is not mentioned the default USER will be used.

How link a local repository with some code inside to an existing Bitbucket repository -with some code inside too?

Everything is in the title, I'm wondering how to link a local repository to a Bitbucket repository, I find nothing on Google currently,
any hint would be great,
thanks

Need a way to update two gitlab repositories through single intellij project window

I am working on a project which is hosted on a particular gitlab repository. Often we dont get to connect to this repository because of network issues. Hence I have created my own local gitlab repository.
Now to keep the both repositories updated, i have to copy paste the code from one folder linked to one repository to other folder which is linked to other repository.
Is there a way in intellij wherein i can work in the same window but when committing and pushing the changes, both the repositories get updated at the same time ?
Regards,
Thanks in advance
Personally, I think it is far, far easier to use Git from the terminal/powershell.
If you are interested in using the terminal, or powershell, with Git, and want set multiple remote origins, then there is a already a detailed answer about pushing and pulling from multiple remote locations.
Otherwise, look at Intellij's VCS menu, then select "Git."
Then select "remotes":
Then get add your other Git remotes by clicking "+" and add:
Add you should be set. Just select which remote you would like to push to.

How can I clone a public launchpad repository without login?

I only want to clone some things, without changing them.
Is there any way to clone a repository without all the hassle of opening an account, setting up a SSH key, etc?
It's really easy. Use bzr branch lp:PROJECTNAME.
Example (no Launchpad login or keys on this machine):
$ bzr branch lp:bzr
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
and then it proceeds to download the code.
For those that can't or don't want to install Bazaar, we can download a tarball of a specific revision.
For example:
curl -sLo sakura.tar https://bazaar.launchpad.net/~dabisu/sakura/sakura/tarball/621
Where the revision number is a change from https://bazaar.launchpad.net/~dabisu/sakura/sakura/changes.
Or, maybe the project has the project source available for download from its project page:
curl -sLo sakura.tar.bz2 https://launchpad.net/sakura/trunk/3.7.1/+download/sakura-3.7.1.tar.bz2

"Bare" git repository: how can I let Apache always "see" the latest commit?

We've got a "bare" git repository on a server, for a Web portal project. Several programmers, designers, etc... perform dozens of push and pull from/to it.
Now we want to test the project on the server itself, and always test the last commit through an Apache web server which is installed on the same machine the "bare" git repository is stored in.
How can we 'unbare' the repository, and let the working directory contain always and only the last commit deriving from the last push?
Or anything else aiming to achieve the same result?
You can use a post-receive hook to do a git pull inside your webserver document root/repository.
in your bare repository
do
mv hooks/post-receive.sample hooks/post-receive
chmod +x .git/hooks/post-receive
the post receive should be something like
#!/bin/sh
WEB_ROOT='/var/www/project'
cd $WEB_ROOT
git pull
A more elegant solution that doesn't involve that the web server area being a git repository, you can also review the git documentation about hooks
Note: if you use the simple solution, please make sure that your webserver doesn't serve the .git directory, this would give some hackers/crackers the access to the website source code!