gushan said:
git log
commit bea9731ee9de15b49611270b51569bdca5f1da76
Author: Agus Hanapi
Date: Wed May 4 08:46:36 2016 +0700
Added a README file
This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.
In this step, we will set up the project for our new website. It is generally a best practice to develop a website with a source control management (SCM) system. For Heroku, the hosting provider we are using, it is a requirement. So we'll install some SCM software if we don't have it already, create a new project, add a file to that project and then commit it to the project.
"git" is a free, open source SCM that we will use to version control our project. Available for Windows, Mac and Linux, git is very popular and becoming widely adopted in the web development community.
You can download and install here.
Creating our project is as simple as creating a new folder on our computer. This folder can live anywhere you want to keep your web work. If you have any doubt where to put the folder, go ahead and create it on your desktop.
Open a terminal window and navigate to the folder you just created. Once inside, initialize the project by typing:
git init
Now that we have an empty repository to work with, we'll create a new file to add to the project. It is customary to include a README file in all your programming project - canonically accepted helper documentation to which the next developer who works on your project can refer. In this case, we'll create a new text file using the editor of our choice and call it README.md.
Inside the new file, we'll add a little text for people to learn something about our project.
Hello World with Python ========================== This is my first website using Python. I hope you like it. Credits -------------------------- * Author: [your name here!] * Peer: [list your favorite peers from P2PU]
Once we have a README file for our project, we need to tell git about it so it can track all its versions. To do this, we use our terminal window again and type the following command:
git add README.md
After we tell git that we want the file to be version controlled, we need to "commit" it to the project. A commit tells git that you are finished working with the file - that this version is complete. Again, we use our terminal window and type the following command:
git commit -a -m "Added a README file"
Now it's time to share your work with your peers! In order to do this, we need to share our commit log with the group. The commit log is a list of the versions of the files you've made so far. This will show if we completed the task correctly.
Yet again, we go to our terminal window and use a git command:
git log
Copy/paste the product of the command, and post in a comment to the task. Note - git log will include your email address. If you would prefer not to share with the group, go ahead and delete the line it is on.
git log
commit bea9731ee9de15b49611270b51569bdca5f1da76
Author: Agus Hanapi
Date: Wed May 4 08:46:36 2016 +0700
Added a README file
commit 791001a52d3cf5f82165e266c7756a23f09731b8
Author: Vivek <newton2304@gmail.com>
Date: Sun Apr 12 23:13:31 2015 +0530
commit 8d087f94bdca8b92e8cb0b90ab64eaf3ad75689b
Author: Tachyon5 <franctaylor.ft@gmail.com>
Date: Fri Apr 4 13:59:33 2014 -0700
Added a README file
commit f549bdc1c5ad8ef25278a40537ae05c501362f84
Author: fer <fer@debian>
Date: Thu Nov 14 11:11:36 2013 +0000
Added a README file
This is the output
commit 91a49c5b241ba476bfede059c02754cf88399583
Author: magi
Date: Mon Aug 6 11:12:47 2012 +0530
Added a README file