My favorites | Sign in
Project Home Wiki Issues Source
Search
for
GitFAQ  
Frequently asked questions about Git.
Git
Updated Oct 24, 2011 by dborowitz@google.com

Git FAQ

Where can I learn more about Git?

The community-edited Git book is a good place to start.

How do I convert my Subversion or Mercurial repository to Git?

There are open source tools to do conversions to Git from many version control systems. We have had success with git-svn and hg-fast-export for Subversion and Mercurial, respectively, but others might work for you as well.

How do I reset my repository?

Project owners can click the "reset" link at the bottom of the checkout page. This is useful if you accidentally committed sensitive information to the repository or if you want to push from an unrelated repository.

Is there a size limit on git repositories?

For all source control systems, there is a 4-GiB repository size limit. For git, we are starting with a push size limit of 500 MiB. If you try to push a pack over 500 MiB, your push will fail. We hope to lift this limit.

What version of Git is required?

At least 1.6.6.

Where did my wiki go?

Project wikis are stored in version control. For Subversion projects, the wiki can be found in "/wiki" in the root of the repository, and for Git and Mercurial projects, the wiki is stored in the separate "wiki" repository.

If you convert your project from one version control system to another, you will also need to copy any wiki files into the appropriate new location. You can temporarily switch back to your old version control system and all your data, including the wiki, will still be there.

Why does Git refuse to push, saying "everything up to date"?

If you cloned a brand new repo with just a master branch, then the command you probably want is git push origin master.

More generally, git push <remote> with no additional arguments only pushes branches that exist in the remote already. If the remote repository is empty, nothing will be pushed. So, you should explicitly specify a branch to push, i.e. git push <remote> <branch>.

Can I access my repository over git:// or ssh:// instead of https:// ?

In order to take advantage of the advanced scalability and load-balancing features of Google's production servers, we are only able to accept incoming HTTP connections. We have no plans to support protocols other than the Git Smart HTTP protocol introduced in v1.6.6.

We do support both anonymous (read-only) and authenticated (read/write) access over HTTPS.

I put my credentials in .netrc, so why does git still ask me for a password?

The C git client always asks for a password if you have a username in the URL. Check your command line and .git/config file and make sure that your code.google.com URLs do not include your username (the part up to the @).

Comment by nicolas....@gmail.com, Jul 15, 2011

Why no git:// support? Are you that allergic to non-80 TCP ports?

Comment by alex.ble...@gmail.com, Jul 15, 2011

Smart http, which is available from 1.6.6 onwards, is the git:// protocol wrapped in an HTTP stream. So there's no real difference between the two, except that HTTP is more accessible and can be proxied and routed more flexibly than the git protocol can.

Comment by microcai...@gmail.com, Jul 17, 2011

how to use ??????

I can't use it!

Comment by microcai...@gmail.com, Jul 17, 2011

Error: no DAV locking support on remote repo https://

Comment by KEWIN2...@gmail.com, Jul 25, 2011

only http:// support not like github git:// ??

Comment by project member dborowitz@google.com, Jul 27, 2011

@nicolas.alvarez, alex.blewitt, KEWIN2010 - I added a FAQ entry about non-HTTP protocols to clarify those that we can't support.

@alex.blewitt - Smart HTTP is kind of like git:// wrapped over HTTP, but with some important differences. The one that makes it truly incompatible with our production infrastructure is that the git:// negotiation phase is stateful and requires a fully bidirectional socket; in the smart HTTP protocol this is implemented by multiple round-trip stateless HTTP requests (with some tricks to partially reconstruct the server's internal state). I'd be happy to go into more detail, but perhaps this wiki entry is not the place :)

@microcaicai - It sounds like you're using a git version prior to v1.6.6.

Comment by jkrid...@gmail.com, Jul 27, 2011

What happens to your subversion data if you convert your project to git? I seem to have lost my wiki!!!

Comment by project member dborowitz@google.com, Jul 28, 2011

@jkridner - I've clarified the FAQ about losing your wiki data, let me know if it's still unclear.

Comment by ius...@google.com, Aug 4, 2011

I've converted the wiki for ganeti.googlecode.com together with history, but now http://code.google.com/p/ganeti/w/list shows the same timestamp and author for all wiki pages (the timestamp being the timestamp of the push and the author being the author of the last edit).

Is this a known issue?

Comment by panyong...@gmail.com, Aug 5, 2011

Same issue above.

Please provide a full guide for switching from Subversion to Git. I managed it myself, but this should be documented in this Wiki.

Comment by shij...@gmail.com, Aug 9, 2011

I have git repository in my local pc, how can I push

the repository into the google code?
thanks

Comment by rion4ik, Aug 10, 2011

git continues to ask for password even after setting ~/.netrc file as described on "checkout" page or here http://kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt (step 3).

I also tried curl command as described by link above but for my project

curl --netrc --location -v https://rion4ik@code.google.com/p/qtnote/HEAD

returns 404 Not found

GET /p/qtnote/HEAD HTTP/1.1
Authorization: Basic somesecretcode_replaced_in_this_example
User-Agent: curl/7.21.7 (x86_64-pc-linux-gnu) libcurl/7.21.7 OpenSSL/1.0.0d zlib/1.2.5 libidn/1.22
Host: code.google.com
Accept: */*

HTTP/1.1 404 Not Found
Date: Wed, 10 Aug 2011 12:01:37 GMT
Content-Type: text/html; charset=UTF-8
Server: codesite
Content-Length: 11801
X-XSS-Protection: 1; mode=block

git version 1.7.6 compiled with curl.

I don't think its a bug in googlecode's git support since nobody else complains but something really wrong.

Comment by project member dborowitz@google.com, Aug 10, 2011

@shijie8:

git remote add googlecode https://code.google.com/p/myprojectname git push googlecode --all

Comment by project member dborowitz@google.com, Aug 10, 2011

@rion4ik:

The git client will always ask for your password if you put a username in the URL, even if you have set up .netrc correctly. Try removing "rion4ik@" from the URL. I will add a FAQ entry about this.

It is expected behavior for the /HEAD URL to not work; that URL out of date and refers to the old ("dumb") HTTP protocol, which we do not support. Try this instead:

curl --netrc --location -v https://code.google.com/p/qtnote/info/refs?service=git-upload-pack

Comment by rion4ik, Aug 11, 2011

yeah. that works! thanks!

Comment by dc.pik...@gmail.com, Aug 12, 2011

> for Git and Mercurial projects, the wiki is stored in the separate "wiki" repository.

whats the URL for that separate repo? I tried

git clone (user) @code.google.com/p/(project)/wiki git clone (user) @code.google.com/p/wiki

Comment by project member dborowitz@google.com, Aug 12, 2011

@dc.pikkle: On your "Source" page, there is a "Repository" dropdown that should contain at least "default" and "wiki." Switching it to "wiki" allows you to browse your wiki repo, and also inclues copy-and-pasteable checkout instructions.

tk;dr git clone https://user@code.google.com/p/project.wiki

Comment by pixi...@gmail.com, Aug 13, 2011

How do you delete a git repository? There is jut a disable and reset option.

Comment by project member dborowitz@google.com, Aug 15, 2011

pixilab: Just disable it. There is a limit on the number of repos you can create in a project, but it's high (50), and if you ask us to raise your limit we generally will.

You may also star this feature request: http://code.google.com/p/support/issues/detail?id=4061

Comment by gregnea...@mac.com, Aug 16, 2011

I've moved my wiki to the Git wiki repo: http://code.google.com/p/munki/source/browse/?repo=wiki

But the moved pages don't show up in the wiki list: http://code.google.com/p/munki/w/list

Creating a new wiki page via the web interface results in a page that shows up in the list and also in the git repo. How can I get my existing (imported) wiki pages to show up?

Comment by project member dborowitz@google.com, Aug 16, 2011

@gregneagle: That's  issue 5703 , and should be fixed tomorrow.

Comment by project member dborowitz@google.com, Aug 16, 2011

@gregneagle: I've manually fixed your wiki. You can edit as much as you like through the web interface, but please don't push from the command line until the above bug is marked as fixed.

Anyone else seeing the problem in  issue 5703 , let me know and I'll fix it.

Comment by gregnea...@mac.com, Aug 16, 2011

Thanks - seeing the Wiki docs now.

Comment by tridg...@gmail.com, Aug 17, 2011

Nice to see git support finally!

Is there any support for git hooks? For example, our project (ArduPilotMega?) would like to be able to deny non fast forward commits to some branches but not others. To do that with git we need commit hooks.

We also like to be able to control the basic config settings in the repo. How is that done with a git repo hosted on code.google.com?

Finally, do you plan on supporting the types of interfaces that github has? For example, individual users being able to easily 'fork' and send pull requests via a web UI?

Comment by jplandr...@gmail.com, Aug 18, 2011

Using Subversion, it's possible to access a file directly from an URL. Like, for example, http://gadget-doc-examples.googlecode.com/svn/trunk/themes/theme_simple.xml

Is it possible to do the same from Git ? I'd like to retrieve the content (and only the content) of this file: http://code.google.com/p/igoogle-aqua-theme/source/browse/aqua.xml With the above URL I only get its content presented inside an html page.

Thanks for the help.

Comment by project member dborowitz@google.com, Aug 18, 2011

@tridge60: For various (mostly security-related) reasons, we don't plan to support running arbitrary user-supplied code as hooks. We may look at other ways to do branch-level access control; for example, Gerrit Code Review supports manipulating branch ALCs through a web UI without the need to write hooks.

As for general config settings, we probably won't directly support using a .git/config file, but there are plenty of knobs we can add, again probably in the web UI. What features do you have in mind? (Also feel free to file specific features as requests on the issue tracker--it's hard to keep track of all the comments on this FAQ page :)

We definitely want to improve the workflow for code review and shipping changes between projects, but I don't have any other details on that at this time.

@jplandrain: There is a "view raw file" link on the bottom of the right-hand sidebar on http://code.google.com/p/igoogle-aqua-theme/source/browse/aqua.xml. Raw git files basically use the same URL scheme as for raw git files, except with "git" instead of "svn/trunk".

Comment by amber...@gmail.com, Sep 7, 2011

Hi, Github offers project forking/pull-requests which are very useful features for collaborating and allows other people to create custom versions of the code. Does Google-Code offer any such features?

Comment by orbeckst, Sep 7, 2011

Related to @jplandrain's question: SVN allows me to add mime types to files so that I can have googlecode serve a html file or an image as content in the user's browser. In this way we can easily serve our html docs from the repository (see http://mdanalysis.googlecode.com/svn/trunk/doc/html/index.html ).

Is something similar possible with the git setup here?

Comment by project member dborowitz@google.com, Sep 8, 2011

@orbeckst: git has no native support for specifying MIME types; for more details, see: http://stackoverflow.com/questions/3537575/can-git-store-the-mime-type-of-a-file-like-svn-does-for-browsing-html

We do try to do a similar kind of MIME type autodetection that you see in webservers like Apache; if it's consistently messing that up, please file a defect report.

I suppose we could read a custom attribute from your .gitattributes file to set the MIME type, but we don't right now. Again, feel free to file an enhancement request.

Comment by electron...@gmail.com, Sep 12, 2011

hello!

git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 216 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Scanning pack: 100% (3/3), done.
remote: Storing objects: 100% (3/3), done.
remote: Processing commits: 100% (1/1), done.
remote: Error: internal server error
error: RPC failed; result=18, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Comment by andrea.spadaccini, Sep 18, 2011

+1, I also have the "RPC failed" error on pushing.

Comment by herzberg...@gmail.com, Sep 19, 2011

Does the Git storage allow for multiple repositories? E.g. one repository for a library and another repository for an example application based on top of that library?

Comment by cette...@gmail.com, Sep 27, 2011

I cant manage to make it work, I do

git clone http://code.google.com/p/linux-ninja-basics

and it initializes a new git repositorie but it frezes, it never ends it I tried:

git init touch READE git add . git commit -m 'README' git remote add origin http://code.google.com/p/linux-ninja-basics git push origin master

but it doesnt work, I really can't get it to work

Comment by project member dborowitz@google.com, Sep 27, 2011

@cette: In order to push, you need to use "https" in the URL instead of "http". What is the specific error message you get when you try to push?

Comment by zorze...@gmail.com, Oct 6, 2011

The link you provide for git-svn is a Not Found.

Comment by project member dborowitz@google.com, Oct 6, 2011

Sorry about the broken link; kernel.org has been having some server issues. Fixed.

Comment by eric.cha...@gmail.com, Oct 7, 2011

Where does .netrc go?

Comment by suddym...@gmail.com, Oct 9, 2011

i had get an error like that: $ git push --all fatal: http://code.google.com/p/ios5/info/refs not found: did you run git update-server-info on the server? how can i do to fix it?

btw: i just create a new project to work with googlecode's git. but after i create a project and check out the empty git rep into local. Then I add some file in the local and try to push, I get this error.

Comment by lassalle...@gmail.com, Nov 2, 2011

When I try to push with the following command: git push origin master:origin/remy I get the following error: error: no DAV locking support on https://...

I am using version 1.7.5.4 of git, so I guees I am in a different situation than microcaicai. I am behind a proxy, but I can clone without any issue, so do not suspect this to be the problem. Thanks you to anyone who could help me.

Comment by project member dborowitz@google.com, Dec 5, 2011

Hi all,

If you're getting the nondescript "https://.../info/refs not found: did you run git update-server-info on the server" error message, please try your pushes again. We've recently made some changes to return hopefully much more useful error messages.

Comment by yoz...@gmail.com, Dec 22, 2011

Is there any step-by-step guide for migrating from SVN to GIT? I do not really understand the info about the wikis since I created them only through the web interface.

Under Administrator->Source, I clicked "Switch to GIT". I don't have my source checked in yet, but my wikis disappeared. I am not sure what process I need to take to have those available again via the web interface.

Because of that issue, I switched back to SVN. I note that my wikis are back, but they all have been updated to show me and the current time as the "Changed" info.

Thanks for any tips on doing this all via the web interface. If that goes well, I'm then planning on migrating from our in-house CVS repository to the Google GIT repository. I suspect that will be an issue itself since I'd certainly prefer to migrate all the history/versions possible from CVS to GIT.

Comment by gilbe...@gmail.com, Jan 7, 2012

I converted my project from subversion to git, but the first 'git clone' I do to try to migrate my code fails with the info/refs problem:

$ git clone https://code.google.com/p/instmake Initialized empty Git repository in /ws/gilramir-sjc/prj/instmake/.git/ fatal: https://code.google.com/p/instmake/info/refs not found: did you run git update-server-info on the server?

Comment by gilbe...@gmail.com, Jan 7, 2012

Regarding my git clone failure, I was using git version 1.6.2.4; once I switched to git 1.7.8.3 everything worked fine.

As the instructions say, git version 1.6.6 or above is needed!

Comment by RMP8...@gmail.com, Jan 14, 2012

Google-Team: Please add the FAQ information that some information (e.g. access-timestamp of a file etc.) will be lost in git (as against svn). Folks will be interested in and write less complains. Thanks.

Comment by jeremy.collake@gmail.com, Feb 1, 2012

CVS, SVN, GIT, Mercurial .. bleh.. People should research the advantages and disadvantages of each and decide whether you really need to switch your project to a different source control system. Many do it just because of the latest fad, and if you chase that monkey, you'll be switching every other year. Git has some nice improvements, for instance, BUT they aren't really useful for everyone. Again, take care and make sure you really want to change something that is not broken. Just my two cents.

Comment by manigand...@gmail.com, Feb 6, 2012

Can anyone help me to find out the git push size (in bytes) using the pre-receive hook? I want to abort the git push, if the size exceeds my limit.

Comment by chaosking0912, Feb 29, 2012

Wow, it's really difficult to get Git working when using googlecode project hosting! 1. Make sure your git config file looks sth. like this:

["origin"]
fetch = +refs/heads/:refs/remotes/origin/ 
url = https://code.google.com/p/projectname/

2. Make sure you created the .netrc (unix) or netrc (windows) file in your user home directory with following content:

machine code.google.com login <login> password <login>

Took me ours too find this out! Regards, Dennis Fischer


Sign in to add a comment
Powered by Google Project Hosting