I want to put my project to the github, but I always failed. I use following steps to do it:
git pull git@github.com: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!
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 git@github.com:username/somerepo.git
3) Make changes, commit it to local repo and push to remote by git push
5)????
6) Proffit
If you have created a new repo on GitHub, the simplest way to use it is:
You have to add the remote location before pushing it. git remote add origin git@github.com:myAccount/myProject.git http://help.github.com/create-a-repo/ Go to the "more about remotes"
After created you project on github, you have :
git clone git@github.com: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.
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 git@github.com/[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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.