Git will keep track of changes you make to your project.
1. Initialize a Git repo
This will introduce Git into your project. Create a local repo.
git init
2. Add Remote
Add a remote GitHub repository to your project.
git remote add origin git@github.com:XxxxxxX/welcomeToBrixton.git
3. Add a file to staging
move file(s) from the working directory to a staging area. The flag . will add all files.
git add .
4. Commit
commit all staged files to Git. -m is a flag used to attach a commit message.
git commit -m "commit message"
5. Push to GitHub
This will send your project which is currently on your local machine to a remote GitHub repository. -u is a flag you can use to set upstream
git push origin <branch>
6. Log
List all the commit(s) with a hash.
git log
To go to any of the commits, copy the first few characters of the commit hash and then
git checkout <commit_id>
7. Status
List new or modified files not yet committed
git status
Thank you
Top comments (0)