Git all Commands.

1. Install git on local machine
git --version
sudo apt update
sudo apt install git

2. Push code in github

touch .gitignore  <-- (add gitignore)

<Set on Local Machine>
git config --global user.name "Sk Zaffar Ekbal"
git config --global user.email "s.zaffarekbal@gmail.com"
git config --list

git init
git add .
git commit -m "first commit"
git status  <-- To check git status
git remote add origin <git@github.com:skzaffarekbal/covid19.git> <-- add from github site repo
git push -u origin master

<Generate SSH Key>
ssh-keygen -t rsa -b 4096 -C <"s.zaffarekbal@gmail.com">  <-- add your email id
cat <--/home/skzaffarekbal/.ssh/id_rsa.pub-->   <-- add link for ssh key

3. Open Online VS Code in GitHub

https://github1s.com/skzaffarekbal/json-user-album
(After github write 1s)

4. To Clone a project from git
git clone <git@code.nettantra.com:zipdj/zipdj-react-front-end.git>
git branch <-- To check branch.
git remote update <-- To updates the branch.
git checkout zaffar-dev <-- to check out the branch.

git pull origin development <-- to pull from the development.

<Before Push in your branch>
git add .
git commit -m "Responsive"
git commit --amend -m "rename the commit message."
git pull origin zaffar-dev
git push origin zaffar-dev  <-- To push on my branch

git reset --hard  <-- To reset all modified changes.

Leave a Comment

Your email address will not be published. Required fields are marked *