Git
New project

If you start a new project and want to use git, the easiest way is to create and empty repository to the remote server and clone it to your local computer.

Navigate to the target folder and execute command:
git clone https://github.com/my_user/my_repo

Creating a repo with existing code

If you have the project with code, but you haven't created the repo yet, you can follow these instructions to create a local repo and push it to remote repo.

Create the repository to the remote server. In this example the repository will be:
https://github.com/my_user/my_repo

  1. navigate the project folder
  2. git init
  3. git add .
  4. git commit -m "Some Message"
  5. git remote add origin https://my_user:my_pass@github.com/my_user/my_repo
  6. git push origin master

Remote repository

If you clone a remote repository and then check it with the command git remote -v, you will see something like origin https...... The word origin is just a nickname for the remote repository.

You can add that kind of nicknames example like this:
git remote add myRemoteRepo https://github....
And then you can push with the command git push myRemoteRepo localbranch

And you can remove those nicknames like this
git remote remove myRemoteRepo



Toggle Menu