Setting up git
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 3756
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
Struggled with figuring out how to set up git.

Update: READ THIS FIRST!! This guy explains why git and svn are not the same, and why git should not be thought of as an 'upgraded' svn, it is not, it is a totally different thing, git does not replace svn, it's a different feature set and functionality and purpose. Don't follow the fads, use the ones that is right for you.
wildlyinaccurate.com/a-hackers-guide-to-git
:: Quote ::
I think a big part of this is due to many people coming to Git from a conceptually simpler VCS ó probably Subversion ó and trying to apply their past knowledge to Git. Itís easy to understand why people want to do this. Take Subversion, for example. Subversion is simple, right? Itís just files and folders. Commits are numbered sequentially. Even branching and tagging is simple ó itís just like taking a backup of a folder.

Basically, Subversion fits in nicely with our existing computing paradigms. Everybody understands files and folders. Everybody knows that revision #10 was the one after #9 and before #11. But these paradigms break down when you try to apply them to Gitís advanced features.

Thatís why trying to understand Git in this way is wrong. Git doesnít work like Subversion at all. Which is pretty confusing, right? You can add and remove files. You can commit your changes. You can generate diffs and patches which look just like Subversionís. How can something which appears so similar really be so different?


First, after your read the above:

install git, then:

create git config file by running these commands:

git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository

first:
git init

then create your config file by these commands:
git-scm.com/book/en/Getting-Started-First-Time-Git-Setup

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
$ git config --global core.editor nano

check your settings: git config --list
git add *.c
$ git add README
$ git commit -m 'initial project version'

and as this thread notes:
stackoverflow.com/questions/7047752/git-adding-files-to-repo

git remote add origin [path to project, let us say it's google code]
git remote add origin https://email%40domain.com@code.google.com/p/acxi/

say your email address for googlecode is fred@mysite.com then that would be:
git remote add origin https://fred%40mysite.com@code.google.com/p/acxi/

If you screw up the path to the project, or get something else wrong, then do this:
stackoverflow.com/questions/16330404/how-to-remove-remote-origin-from-git-repo

git remote set-url origin git://new.url.here
then:
git push origin master

which will ask you for your password, I'm sure there is a way to store that too.

To make your logins sticky, do this, in $HOME/.netrc create this:

Add the following to your .netrc
machine code.google.com login you@yoursite.com password [generated googlecode.com password]

like so:
machine code.google.com login fred@mysite.com ARR45fdesW2

save it, then git will use that. It seems to work, I tested it.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours