Pushing a repository onto GitHub

2020-07-29 17:29发布

I set up my own Git repository on my own server, and created a repository. I am new to Git, and all I do at the moment is git add *, git commit, and git push. I am not all that familiar with git.

Now, I would love to create a repository on Git Hub, so that the remote GitHub repository has the same list of changes I have on my own server.

I don't suppose you could give me a list of steps, as well as an explanation of what each step will do? My main concern is that I don't want to ruin my current repository.

UPDATE: Thank you everybody. I still don't quite get how GIT works (I am sure I will at some point), but: https://github.com/mercmobily/hotplate :D

标签: git github
4条回答
我欲成王,谁敢阻挡
2楼-- · 2020-07-29 17:41

Here's something that might help GIT_HOW_TO But I believe there are just too many resources on the internet that would help you do it. Steps to setup your repo on github is well mentioned on their Help_Page Please go throught this and if you have any question feel free to ask. BTW Welcome to Git :)

查看更多
可以哭但决不认输i
3楼-- · 2020-07-29 17:48

Don't have time to write a full solution, but basically you need to:

# create a nickname for your github account. In this case it is github
git remote add github your-github-repo-path

Keep committing the changes locally and pushing them. When you want to push also to github, execute:

#push the changes to the repo on the 'github' nickname, to the branch master
git push github master
查看更多
狗以群分
4楼-- · 2020-07-29 17:51

Create a repository and add your remote path to your local machine

In your local machine switch to remote git path

cd ../../../

git pull "name " master 

pwd:"enter your password"

git add Filename

git commit -m "Comments on files"

git push "name" master

i hope this could help you , correct me if 'm worng

查看更多
闹够了就滚
5楼-- · 2020-07-29 17:54

Create a new repository on GitHub, as here: https://help.github.com/articles/creating-a-new-repository

Then do steps 4 and 5 from here: https://stackoverflow.com/a/8012698/705048

查看更多
登录 后发表回答