viernes, 7 de septiembre de 2012

Attach existing directory to a new GIT Hub Repo

So........

This one may sound familiar to you right?

You started working on something and at some point some one tells you: "oh!!!! brilliant upload it Git Hub so I can take a look at it"

And ad that point is when the problem starts.

So how do you update code you are working on (this is an existing project) to a repo you are about to create.

Well this is basically solved in StackOverflow BUT allow me to replicate it here ok?



1. Create the remote repository, and get the URL such asgit://github.com/youruser/somename.git

If your local GIT repo is already set up, skips steps 2 and 3

2. Locally, at the root directory of your source, git init

3. Locally, add and commit what you want in your initial repo (for everything, git add . git commit -m 'initial commit comment')to attach your remote repo with the name 'origin' (like cloning would do)

4. to attach your remote repo with the name 'origin' (like cloning would do) git remote add origin [URL From Step 1]

5. git pull origin master

6. to push up your master branch (change master to something else for a different branch): git push origin master

So this worked pretty well for me to have a look at it.

I case you wander this is the StackOverflow link

No hay comentarios:

Publicar un comentario