let´s practice github basics for beginners!
This README will introduce you to using basic commands for interacting with Git.
You can look at the bottom of this file, if you have not yet done basic git configuration.
You will need a GitHub profile and a computer with Git and your preferred coding environment.
git status
- what is happening
git clone <url>
- clone an existing repository
git init
- turn any directory into a repository
git add <path>
- add changes to staging area
git commit
- commit staged changes
git commit -m "My commit message"
git push
- push commits to remote repo
git pull
- pull commits from remote repo
git checkout –b <branch name>
Create a new branch
git branch -a –v
- inspect all existing branches
git log
- view log of changes
touch filename
to create a file
mkdir directoryname
to create a directory
- Clone this repository to your local machine.
- Use `git status
- What does
git log
look like? - Create a new branch for a feature.
- What does the output from
git status
look like now? - Create a file
touch abc.txt
add
the file to the staging area- How does
git status
look now? commit
the file to the repository- How does
git status
look now? - Change the content of the file you created earlier
- What does
git status
look like now? add
the file change- What does
git status
look like now? - Change the file again
- Make a
commit
- What does the
status
look like now? Thelog
? - Add and commit the newest change
Between each step look at the output of git status
.
Steps: Clone the repository to your local machine. Create a new branch for a feature. Make changes, commit, and push to the branch. Open a pull request to merge changes. Review, discuss, and resolve conflicts if any. Merge the feature branch into the main branch.
git config --global user.name "John Doe"
git config --global user.email "johndoe@example.com