Launchpad and github sync - github

I make launchpad automatically import code of my project from github. If I make changes at launchpad, like adding translations, is there a way to automatically export them to github? Or should I just switch to launchpad for code hosting?

You can use the "dpush" command from the bzr-git plugin to push the changes on Launchpad back into Git.
E.g.:
$ bzr branch lp:~yourusername/yourproject/translations
$ cd translations
$ bzr dpush github:yourgithubusername/yourgithubrepo,branch=translations

I don't see a two-way "roundtrip" mechanism in place to keep a bazaar and a git repo in sync.
That leaves you with bazaar export mechanism like fast-export (described in "Convert bazaar to git").
But the process doesn't seem to be incremental, which could risk at least for the first export to create a different history (different SHA1), making your first export a git push -force (not ideal)
So if your development environment of choice will be launchpad for the near future, switching to its dedicated VCS for now would be simpler.

I tried to do the same and found bzr-git-ng plugin hosted on git:
https://github.com/termie/git-bzr-ng
I didn't try syncing so far myself. Check the Extra Notes in the link above.

Related

How to manage Django Project and its modules with git?

I've been looking for a solution how to manage my project with git for quite some time now. I want to have one instance as the main repo for connecting the entire project. Each app should be its own git instance.
During my search I found both git submodule and git subtree. For both tools I found an instruction how to insert an existing reppo. However, I am interested in how to proceed from the beginning. I mean here from the command $ django-admin startproject myproject Where do I enter the git init? When I create a new app
$ django-admin startapp new-app and how do I use this as subtree/submodule?
Until now I have always found instructions that refer to a remote repo. Is this always necessary? I am not sure if I want to publish every Django app on Github. But I want a version control system just for me. Is this possible?
I have to say that so far it has been enough to manage my "projects" locally. Now I want to work together with others and I don't want to install the whole Django Project locally but only provide me with single functions or modules.
It would be a great help if you could explain to me how that works.
TL;DR
How to manage (start and expand) a Django Project with git. The apps should be their own git repos.
The purpose of submodules is to allow you to graft an existing repo/library into your git. Rarely do you want to do this. Instead you want to use PIP tools to install your libraries as part of library management.
This is essentially a git question. If you don't have a remote repository, you can still use git. With that said, the reason you want a remote repository is so that you can collaborate with others, and have a stored version of the code separate from your workstation.
There are services that let you have private repos even without a paid account. Bitbucket is the most well known of these services and is comparable to Github in most ways.

Is it possible to source control using VS Team Services without using Visual Studio or other IDE?

There are similar questions to this but they mostly have some other purpose than mine, use different tools or end up not being that similar.
I've been searching for another way to source control Dynamics NAV development, as we've been using an in-house add-on called Object Control which merely controls changes to objects and produces .txt backups.
With those .txt backups we could do normal source control using Visual Studio Team Services, but we want to avoid the hassle of opening Visual Studio just to connect it all to Team Services everytime we make changes.
I know Microsoft has a set of REST APIs for retrieving information on repos and projects but i'm not sure how you can send information to the server (new changesets, files, creating projects, etc) without using an IDE.
I'm set on creating an application or interface to bridge the gap between the NAV development and Team Services but is there a way to use and communicate with Team Services on its own?
Yes, you can use the git command line to source control VSTS git repo. You can use git bash (download here).
Frequently commands as below:
git clone <URL of VSTS git repo> #clone a git repo of a VSTS project locally
git add filename #add the file in git repo
git commit –am 'message' #commit the changes with comment: message
git push #push current branch to remote (VSTS git repo)
More git commands, you can refer git book.
Power Tools. It integrates with windows shell and you can do everything w/o opening VS
DLLs that installed along with VS TFS can be used like any other libraries in your application. Or you could even use then in Nav RTC. I used this approach have some inconsistencies but in general it works smoothly. So you can sourcecontrol Nav from Nav itself.
Rest services since you mentioned them. I'm just not sure if they provide access to work items only or to source control as well. For you to explore.
If you chose Git for source control, you just need the command line to commit changes and push them to VSTS.
In VSTS go to Code -> Manage Repositories -> New repostiroy. Choose Git as the type and give it a name. On the top right of the new repository home screen you'll find a button "Clone", copy the URL for the next step.
On your machine install Git then open a command prompt and navigate to the folder with your source code and type
git init
git add .
git commit -m "Initial Commit"
git push --set-upstream <the URL you took from VSTS> master

Newbie Unable to clone repo

I've never used a VCS before and I'm attempting to set one up now.
I'm doing some Game Development with Unity3d. At first I googled how to set up VCS for Unity; and I found this: http://www.gamasutra.com/blogs/BurkayOzdemir/20130303/187697/Using_Unity3D_with_external_VCS_Mercurial__Bitbucket_step_to_step_guide.php
I followed it until it came time to clone the repository from within the hgTortoise workbench. When I hit the clone button after copying and pasting the URL to my repo from the BitBucket.org website I received an error: "Repository Git clone https:://username#bitbucket.org/username/projectName.git not found code: 255" and I do understand what an HTTP 404 error is.
Anyone who has used the internet knows it means the page could not be found.
I created this repo as private; is that why it could not find my repo?
Then I proceeded to follow the instructions at BitBucket's "BitBucket 101" help page. I installed Git, had already created a BitBucket account and repo, and the instructions which followed.
I stopped at the point where the help page said to enter some command line things in to Git Shell. I'm running Windows 8.1 and searches have shown me that particular program doesn't exist on this PC.
Am I doing this correctly? What am I doing wrong? All I need is to set up a VCS.
Git and Mercurial are 2 different distributed version control packages. They both use a command line interface. TortoiseHG (the package referred to in the step-by-step you linked to) is a GUI extension that's only used for Mercurial. (HG is the chemical symbol for Mercury, get it?!)
Bitbucket is an online repository that can host either Git or Mercurial repositories.
It looks like you created your repository on Bitbucket as a Git repo and not a Mercurial repo. Just delete the repo on Bitbucket (make sure you have a good copy of your source code) and recreate it as a Mercurial repo. Then work with TortoiseHG as instructed in the step-by-step.
The fact that it's a private repo doesn't matter. That just means it will only be visible to you (vs. everyone) and will require a password to push and pull changes via https or ssh.
Well, first of all, it seems that the tutorial that you seem to be using is based on using Mercurial instead of Git.
If you're comfortable with diving into the command line, you can download TortoiseHG, which is a Windows shell extension: http://tortoisehg.bitbucket.io/
However, there's nothing wrong with using SourceTree as well, which is a GUI-based interface for dealing with both Git and Mercurial repositories: https://www.sourcetreeapp.com/
FYI, if you downloaded Git for Windows, it should've provided you with a terminal called Git Bash that you can use for Git commands.

Git: Access Control? How to do in practice

how would one protect a GIT repository of a complete (java) application from having a developer getting access to all the source code in the repository. I know GIT is a distributed Versioning Control where a developer normally "downloads/fetches" the complete(!) repository.
My Questions:
How to sperate "modules/autonomous parts" in git? For example havng a module "payment layer" and "database layer" and "processing layer" and so forth all abstracted via APIs/Interfaces. Do i have to setup a seperate git repository for all those modules?
Is there a way to have one large repository in GIT but to somehow restrict the access by path? (A client should only recive those files he was granted access to)
Is there a way to have one large repository in GIT but to somehow restrict the access by Branch/Tags? (A client should only recive those files he was granted access to)
Just in Case someone knows this too: Is there a way in eclipse to chekout content from multiple GIT repositories into one project and also (the other way round) commit code within in one eclipse project to multiple different GIT repositories (based on package names/paths or in the context menu)?
Thank you very much
Markus!
You will have to split up the code into multiple git repositories if you want differential control. You cannot control by branches or whatever. Git downloads the entire repo. Period.
You can look into git modules for a mechanism for making it easier to work with a thing built of multiple git repositories.
1) and 4) depends a lot of your build evironment. In git you try to have separate repositories per modules, but if the setup of the source tree becomes painful you can use git submodules (though not much people like them) or the repo tool the Android project uses. This allows you to have an "umbrella" project composed of more subprojects. Not sure if it is worth it for just a few components. Just one git repo may still make more sense.
For questions 2) and 3):
For access, I would recommend that every sub-team keeps its own fork (repository) and somebody reviews what they push to the integration repository. If you don like this approach, you can use git server hooks to enforce policies writing scripts.
In this case, the hook could check who is pushing, and the path or refspec (branch) against some config file describing the policy. This is documented here:
https://git-scm.com/book/en/v2/Customizing-Git-An-Example-Git-Enforced-Policy
1). Look at Git submodules http://linux.die.net/man/1/git-submodule
2,3). Look at Gitolite https://github.com/sitaramc/gitolite/blob/pu/doc/gitolite.conf.mkd
4). I don't think any eclipse-git plugins allows that. However, you can use an external/command-line client to achieve what you want.

xcode change from svn to git

I am working on an iPhone app improvement project. Original project was done using SVN, however, I want to use git for new changes. When I open xcode4 and see source control, I dont see an option to change the source control settings. How can I change the settings so that I can use a local git repository?
You might need to convert that svn repo to a git repo first, with git-svn for instance.
I would recommend using a script like svn2git for this kind of operation (that is, if you don't have to commit back to the original SVN repo. If you do, git-svn is preferable).