1:Create a git repo on github
2: Initialize git repository with below code.
cd /path/to/your/existing/code
git init
You’ve now got a local git repository. You can use git locally, like that, if you want. But if you want the thing to have a home on github, do the following.
- Go to github.
- Log in to your account.
- Click the new repository button in the top-right. You’ll have an option there to initialize the repository with a README file, but I don’t.
- Click the “Create repository” button.
Now, follow the second set of instructions, “Push an existing repository…”
$ git remote add origin https://github.com/user/repo.git
$ git push -u origin master
adding Note the command "type gitignore.txt(text filename)" . will open content of the file.
to create file :type nul> gitingore.txt
Adding .gitignore file:
- Open Notepad.
- Add the contents of your gitignore file from server ( while creating repository created git ignore file)
- Click “Save as” and select “all files”.
- Save as
.gitignore.
5:set a remote bracnh
git branch -u origin/master
6: TO add files
git add .
7: push to remote server
git push