- Clone this repository
$ git clone https://github.com/karissademi/git-101.git
- Add a .txt file in the
/users
directory. In the file, include
- your name
- job title
- most recent project
- favorite animal
-
Name the file
your-name.txt
-
Enter the directory on your computer
$ cd git-101
- Checkout a new branch e.g.
task/your-name
$ git checkout -b task/karissa-demi
- Check the status of the working directory
$ git status
- Add the file in git
$ git add karissa-demi.txt
- Check the status again
$ git status
- Create a commit message
$ git commit -m "Add my file"
- Create the remote branch and push your changes to the origin
$ git push --set-upstream origin task/sample-user
-
Open a pull request for your branch in the GitHub interface
-
Check the pull request that appears under your own.
-
Provide feedback.
-
Check your original pull request to see if you need to make a change. Even if you don't have any commits, add your favorite food to the file.
-
Make the change and commit.
$ git add <file-name>
$ git commit -m "A commit message that explains the change you made"
- Push the changes
$ git push
-
Merge the orginal pull request.
-
Switch back to the master branch
$ git checkout master
- Get all the changes we've been making on your local copy
$ git pull
- See all the changes
$ git log
- Delete your branch
$ git branch -D <branch-name>
Forgot your branch name?
$ git branch