Rod McLaughlin

More difficulties with Github (12 nov 12)

To maintain a Github repository, I found I had to

 a. work on the project locally
b. create a new folder
c. cd into it
d. git init
e. git remote add origin
f. git pull origin master
g. Copy any files which have changed, and new files, from your original folder into the new one
h. git add ANY NEW FILES
i. git commit -a
j. git push origin master

If you work on your local copy of a Github repository without pulling from Github, and 

$ git push origin master

it says you have to

$ git pull origin master 

first, and you get lots of conflicts in irrelevant files like development.log which it wants you to resolve. The fact that you have a .gitignore file which told it not to check those files in in the first place doesn't seem to have worked.



Duh. If you use Github, you have to use it like a central code repository. You always need to update before you commit, even if you are the only committer. What you have to do, before changing anything locally, is

 a. cd into the project folder
b. git remote add origin
c. git pull origin master
d. Create, delete and change files
e. git add NEW FILES
f. git commit -a
g. git push origin master

or... branch:

Portland London