- Go to https://git-scm.com download the installer and install it leaving everything by default (you can check that it was successful via windows console with the
git --version
command). - Run windows console via
cmd
command and go to the project root folder (or run it from that folder). - Execute the
git init
command (it will create the ".git" hidden folder inside your project folder). - Run the
git status
command to check that nothing has been added to Git yet. - To make some files (or folders) be tracked by Git run the
git add filename.fileext
command (you can rungit status
after to check whether the file has been added and ready to be commited). - Add to the project root folder a new file called
.gitignore
. It should be a text file. Open it and write to it all files and folder (each one on a new line) you want to be ignored by Git. For example:node_modules/
- Add the
.gitignore
file to Git too (see step 5). - Commit all the files you've added using the
git commit -m "Put you comment in here"
. After that any changes to these files will be tracked by Git.
- Open Git Bash (not windows console).
- Check if you already have an existing SSH key: ls -al ~/.ssh (if it exists then skip this process).
- Run
ssh-keygen -t rsa -b 4096 -C '[email protected]'
. Press enter (by default) for all questions.
- Open Git Bash.
- Run the command
eval "$(ssh-agent -s)"
. (This will start up the SSH agent program and it will also print the process ID to confirm it is indeed running) - Tell the SSH agent the folder path where the private key lives:
ssh-add ~/.ssh/id_rsa
. (expected message: "Idenity added..")
- Go to github.com
-> Account menu -> Settings -> SSH and GPG keys
and add your SSH key in there. - In order to test your connection run the
ssh -T [email protected]
command. It should sayThe authenticity of host 'github.com (192.30.253.113)' can't be established.
. It's ok, enteryes
. If successful, you will see the message starting with "Warning: Permanently added ...". - Go to the GitHum home page and create a new repository there.
- Assosiante your new prepository with your local project by running the
git remote add origin https://github.com/YouUserName/you-repository-name.git
command from your project directory (via windows console). - Push your sources to the GitHum repository:
git push -u origin master
.
Git free e-book: https://git-scm.com/book/en/v2
Generating SSH keys: https://help.github.com/articles/connecting-to-github-with-ssh/