The purpose of this repository is to play with Git (commands and workflow) and contribute/share knowledge with others using Github.
Install Git on your computer.
Sign Up for Github. The website will ask you for a username, email and password.
Fork the repository Apprentice-Git-Github. This will create a copy of the repository on your profile to start working with.
Open a Terminal and clone the repository you already forked (the one that is on your account), use the next command on your terminal (in case you're using a client, follow program wizard).
git clone https://github.com/[YOUR-ACCOUNT]/Apprentice-Git-Github
This will create a copy on your computer of the repository.
Check the status of the repository. It's a good practice to start doing this, bash git status
will show you the current state of your repository.
git status
Let's add our information to git. It's important to bring an email and your name to help git identify who made a change on a file. This can be done modifying the next commands.
git config user.name "YOUR_NAME"
git config user.email "YOUR_EMAIL"
Create a directory with the initial of your first name and concatenate your last name. For example Juan Resendiz will become jresendiz.
mkdir jresendiz
Now create a file called, personal_information.txt inside the created directory and edit the file. You can add whatever you want on the file. Save the changes.
Check the status of the repository. Git will show you that a new file exists and it's Untracked. The file will keep in that way unless we decide to add it. Let's add the file.
git add jresendiz/personal_information.txt
Check the status again, now you will see that the file that you created is part of the staging area and it's ready to be commited. Let's commit the file and add a message to that commit.
git commit -m "Creating my file"
Don't forget to change the message and add something related to what you just did or write on the file.
The file you created has just become part of the git history, let's take a look to the log and see what's in the history.
git log
This will show you part of the repository history. The first commit information that appears, is the commit you just made!.
Let's update our remote repository, just follow the next command.
git push origin master
This command will ask you for your github credentials (username/password).
Now your local repository and your remote repository are up to date!.
Create a pull request. Just enter to your repository and go to Pull Requests tab, click on New pull request. Set the base fork to Apprentice-Git-Github on base master and the head fork to your local repository, and compare branch to master.
Consider the next image as example.