- "GIT-IT," an exclusive GitHub session organized by the FOSS Community of NSBM in collaboration with Women in FOSS NSBM.
Download Git:
- Download git for Windows.
- Download git for Mac.
- Download git for Linux & Unix.
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
So, let's get started!
This command is used to obtain a repository from an existing URL.
Git clone <repository url>
Open repository in local storage
Cd <repository name>
Checkout a branch into your working tree
Git checkout -b name
git checkout branchname
List down branches
git branch
This command lists all the files that have to be committed.
git status
This command adds a file to the staging area.
git add .
This command records or snapshots the file permanently in the version history.
git commit -m 'commit message'
This command sends the committed changes of master branch to your remote repository.
git push
- if we create a branch locally
git push --set-upstream origin <branch name>
This command is used to list the version history for the current branch.
git log