0

New to Git.

I have a root folder containing source I'd like to add to a local Git repository.

This is what I did (did I miss anything?)

Go to the root folder

cd ~/MySource

Create the repository

git init

Add Everything

git add .

Commit everything

git commit -m "First commit, hope it works"

No errors, so we're good to go ? My development tool has Git and built in and it looks all ok...

Ian Vink
  • 66,960
  • 104
  • 341
  • 555
  • it looks fine. Check this answer: http://stackoverflow.com/questions/7632454/how-to-use-git-bare-init-repository – ppaulojr Sep 23 '13 at 00:17

1 Answers1

2

Yeap, you've now put your code under Version Control.

I Strongly recommend, if you are new to Git, to take this Quick Curse to learning Git -> Got 15 minutes and want to learn Git?

If you commit to Github you may set your configs

$ git config --global user.name "Your Name"               # Set your Git name     
$ git config --global user.email youremail@gmail.com      # Set your Git email

Set your Code under Version Conroll

$ git init                          # Set up Git on your project    
$ git status                        # See tracked, untracked, and staged files 
$ git add .                         # Add new files to Git    
$ git commit -am "Initial commit"   # Save your project files to Git

Commit to GitHub

$ git remote add origin git@github.com:yourusername/yours.git     # Set up git to push to your Github repository
$ git push -u origin master         # Push your code to Github (sets the upstream the first time)
$ git push                          # Push your code to Github
Mini John
  • 7,855
  • 9
  • 59
  • 108