Git and GitHub for Beginners #4

Source: Google

Tracking our Project

  • Setting our username and email:
git config --global user.name "<your_user_name>"git config --global user.email "<your_email>"
git config user.name
  • Adding files to staging area:
git status
On branch masterNo commits yetUntracked files:
(use "git add <file>..." to include in what will be committed)
factorial.py
fibonacci.py
hello world.py
nothing added to commit but untracked files present (use "git add" to track)
git add factorial.py
On branch masterNo commits yetChanges to be committed:
(use "git rm --cached <file>..." to unstage)
new file: factorial.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
fibonacci.py
hello world.py
git add <file_name_1> <file_name_2> <file_name_3>
git add -A
On branch masterNo commits yetChanges to be committed:
(use "git rm --cached <file>..." to unstage)
new file: factorial.py
new file: fibonacci.py
new file: hello world.py
  • Committing the changes:
git commit -m "<your_message>"
git commit -m "initial commit"
[master (root-commit) 5cdc9df] initial commit
3 files changed, 25 insertions(+)
create mode 100644 factorial.py
create mode 100644 fibonacci.py
create mode 100644 hello world.py
On branch master
nothing to commit, working tree clean
  • Checking the commit history of repository:
git log
commit fec2a05066ae897622e376efd6f43524b9c00890 (HEAD -> master)
Author: user_name <email@email.com>
Date: Sat Jun 20 17:42:12 2020 +0530
wrote fibonacci function using dynamic programming
commit 5cdc9df4ee9ce96d093c3fdbd6cd1f976bf4a409
Author: user_name <email@email.com>
Date: Sat Jun 20 17:24:01 2020 +0530
initial commit

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhishek Raghav

Hey there! I am an undergrad at IIT Jodhpur (2019–23) pursuing B. Tech. in CSE. Being a tech enthusiast, I love to gain and share knowledge about tech content.