Reputation: 2687
I want to put my project to the github, but I always failed. I use following steps to do it:
git pull [email protected]:myAccount/myProject.git
git add .
git commit -m "inital"
git push -u origin master
After that, I open the github in safari, and my project exists. But the problem is the folder TestPro can't be open, and there is nothing under it.
Could anyone tell me how to add existing project to the github? I have read the instructions on github, but I still can't find the solution and where am I wrong.
The local project I refer is a local git repository. Does it matter? should I checkout it first?
Thanks!
Upvotes: 0
Views: 605
Reputation: 34318
The steps are :
1. cd "/path/to/project_folder"
2. git init
3. git add .
4. git commit -m "Your Message"
5. git remote add github https://github.com/[your_user_name]/[repo_name]
6. git push origin master
or, if you want to clone first. Then,
1. git clone [email protected]/[your_user_name]/[repo_name]
Then, you can make changes to the files that you cloned.
Next, use the following commands :
2. git add .
3. git commit -m "Your Message"
4. git remote add github https://github.com/[your_user_name]/[repo_name]
4. git push origin master
Upvotes: 0
Reputation: 54
After created you project on github, you have :
git clone [email protected]:myAccoun/myProject.git
git pull is git fetch and git merge. Used it after to refresh your repository. .git is automatically manage by git, so it's no necessary to add to track.
Upvotes: 0
Reputation: 4283
You have to add the remote location before pushing it. git remote add origin [email protected]:myAccount/myProject.git http://help.github.com/create-a-repo/ Go to the "more about remotes"
Upvotes: 0
Reputation: 1323313
If you have created a new repo on GitHub, the simplest way to use it is:
Upvotes: 0
Reputation: 371
After creating repo on github
1) configure ssh-keys, then set your git.username and git.email
2) Clone repo using git clone
git clone [email protected]:username/somerepo.git
3) Make changes, commit it to local repo and push to remote by git push
5)????
6) Proffit
Upvotes: 1