add google code as a remote in git for intellij

add remote for intellij

I use intellij to create a local git repo.

To add a new remote:

1. create a project in google code.

2. go to this link: https://code.google.com/hosting/settings. Copy the

machine code.google.com login xxxxx@gmail.com password xxxxxxxxx 
to the user directory’s .netrc file: ~/.netrc
then change the priv for this file, could be 500/600, i use 600
chmod 600 .netrc
 
3. go to the project root(where you create the git local repo). use;

git remote add googlecode https://code.google.com/p/xxxxxx/

this will add google code as your remote.

To verify the remote:

git remote -v

4. now you can go to intellij VSC->git-> push to push change to your remote. Or just use command line: git push googlecode HEAD

About git remote add and push .. master

  1. What is git remote add ...As you probably know, git is a distributed version control system. Most operations are done locally. To communicate with the outside world, git uses what are called remotes. These are repositories other than the one on your local disk which you can push your changes into (so that other people can see them) or pull from (so that you can get others changes). The command git remote add origin git@github.com:peter/first_app.gitcreates a new remote called origin located at git@github.com:peter/first_app.git. Once you do this, in your push commands, you can push to origin instead of typing out the whole URL.
  2. What is git push origin masterThis is a command that says “push the commits in the local branch named master to the remote named origin“. Once this is executed, all the stuff that you last synchronised with origin will be sent to the remote repository and other people will be able to see them there.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s