Git command

SSH ket set up

Using GitBash 

1. git config --list
2. git config --global user.name "John Doe"
3. git config --global user.email johndoe@example.com
4. ssh-keygen -t ed25519 -C "your_email@example.com"
5. clip < ~/.ssh/id_ed25519.pub
6. enterpassword

for ubantu -- 
the private key identities to the authentication agent like so:
ssh-add

Then you can ssh into your server.

in addition, you can see the list of fingerprints of all identities currently added by:

ssh-add -l

after that set SSH key

git lab-> profile ->setting
->> ssh key-key-> paste key

Now open git bash and clone the repository and enter password

The complete guide to SSH keys in GitLab - Spectral (spectralops.io)

Clone a branch

git clone -b <branchname> <remote-repo-url>
Git global setup
git config --global user.name "G Gurmangat"
git config --global user.email ""
Create a new repository
git clone git@gitlab.
cd rihms
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
Push an existing folder
cd existing_folder
git init
git remote add origin 
git add .
git commit -m "Initial commit"
git push -u origin master

 

Push an existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin 
git push -u origin --all
git push -u origin --tags


 git init

Step 1.  <source folder> git clone git url

step 2. git switch developer


 Git pull ,push and merge with master

step 1. commit all the changes to current branch.

step 2. git switch master (switch to master)

step 3. git pull origin master (fetch latest code from master)

step 4. git switch developer

step 5. git merge master

while merging if find any conflict , merge manually and accept that.

step 6. git push origin  developer  (push the changes)

now create a merge request to merge the changes.


git branch   - show the branch which are active and your current branch is in Green color.




step 1. commit all the changes to current branch.

step 2. git merge master

while merging if find any conflict , merge manually and accept that.

step 3. git push origin  developer  (push the changes)

now create a merge request to merge the changes.


Comments

Popular posts from this blog

Microsoft Enterprise Library-Data Access Application Block for for .Net Core & .Net Standard

Asp .Net Core

Asp .Net Core -Startup Class and the Service Configuration