I want to sync my code to my github repo, so anytime I update my code it should be updated in the repo. Is there any proper and structured way of doing this.
Asked
Active
Viewed 209 times
-2
-
Have you followed any [GitHub tutorials](https://guides.github.com/activities/hello-world/)? Where are you getting confused? – Chris Dec 10 '15 at 21:50
-
i followed the second answer given [here](http://stackoverflow.com/questions/27059639/syncing-local-laravel-project-with-existing-git-repository) but it is for one time or manually doing it every time. @Chris – Chaudhry Waqas Dec 10 '15 at 21:56
-
3use git over cli or a the github client and commit and push your code! If you do not have enough knowledge about git, learn it! https://laracasts.com/series/git-me-some-version-control – Timo002 Dec 10 '15 at 21:57
1 Answers
0
So this is how I am doing it now
1
$ cd my-project
$ git init
$ git remote add origin GITHUB_URL
$ git pull origin master
$ git status
$ git add .
$ git commit -m "Init repo."
$ git push -u origin master
then just repeat following steps
$ git add .
$ git commit -m "Init repo."
$ git push -u origin master
![](../../users/profiles/3421131.webp)
Chaudhry Waqas
- 1,963
- 6
- 33
- 57