Git

Git 

Git is a version control system, used to collaborate on code and keep track of code changes.

Pocket cheat book for git and GitHub repo:

#configure

Download git bash by this Git link

1. open git bash

# to generate an ssh key to secure your git repo only you can have access. enter the below command and generate with or without passPhrase then you will get the location of the stored .Pub file. Open the file with a notepad and copy it.
2. ssh-keygen 

#paste ssh key to github profile.
3.  goto the setting and click SSH and GPG keys and paste. Now you are good to go.

4. goto any repo and click or create new repo going to profile, Then click on file select ssh link to repo.

5. Run the Below commands for configuration:
# list configs
$ git config --list 

# set config
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
6. Clone.
$ git clone (copied ssh key) (foldername to save)

# check branch in remote or origin
git branch -a

# check branch locally
git branch

# check status of local branch
git status

# get update from branch to local branch
git checkout (local branch name) 
git pull origin (remote branch name)

# change or create new branch with remote origin
git checkout -b (local new branch name) origin/(remote branch name) 

# Before adding changes from local to remote branch
1. stage (add)
2. commit
3. push

# its comfortable to use git user-interface to check the changes and make above steps:
# go to git user-interface new window popup will come.
 git gui
#else: check status

git status
1. adding(staging)
#for all files
git add -a
# for single file
git add (file location)


2. commit
git commit -m ("message for reference")

3. push
git pull origin (remote branch)
# if no conflict
git push origin (remote branch)

Comments

Popular posts from this blog

Domain Check Tool

Docker

Unlocking the Secrets of Natural Language Processing: How AI Is Changing Communication