Posts

Showing posts from January, 2018

gitlab-1

 Command line instructions Git global setup git config --global user.name "Ashish Aggarwal" git config --global user.email "ashish.7788@gmail.com" Create a new repository git clone https://gitlab.com/ashish7788/across.git cd across touch README.md git add README.md git commit -m "add README" git push -u origin master Existing folder cd existing_folder git init git remote add origin https://gitlab.com/ashish7788/across.git git add . git commit -m "Initial commit" git push -u origin master Existing Git repository cd existing_repo git remote rename origin old-origin git remote add origin https://gitlab.com/ashish7788/across.git git push -u origin --all git push -u origin --tags

Github-3 : Working with local repository

Working with local repository New Repository Repositary Name and description -> Add Repositary Their are two way to perform git operation A. Follow web instructions B. Cloneit locally Type ‘Git clone SSH(get it from git)’ so my command is ‘git clone https://github.com/divakar1592singh/my-first-repo.git' One folder created in your local location  Divakars-MacBook-Air:git divakar$ cd my-first-repo Divakars-MacBook-Air:my-first-repo divakar$ touch index.html main.js Type ‘git add -A’ TYPE ‘git commit -m “my first repo” ‘ Git push origin master - master is name of branch. Push command upload your data from local to git Git pull origin master - master is name of branch. Pull command retrieve your data from git to local Create readme.md fil

Github-2 : Setting Up Github

Setting up Github Adding SSH key - Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to GitHub without supplying your username or password at each visit. Go to web 'https://help.github.com/articles/connecting-to-github-with-ssh/‘ or type GitHub ssh key Click on ‘Generating new SSH key and adding it to the ssh-agent’ Select device Mac/Window/Linux ( I am on MAC) Follow the instruction of website Generating a new SSH key Open Terminal. Paste the text below, substituting in your GitHub email address. ssh-keygen -t rsa -b 4096 -C "your_email@example.com" This creates a new ssh key, using the provided email as a label. Generating public/private rsa key pair. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location. Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter] At the prompt,...

Github-1 : Basic Setup

Basic Setup First create a README.md (md = markdown file) from terminal in your git directory Open README.md file in vim  ‘vim README.md’. Type text, whatever you want like - ###My first title and exit. Type ‘git status in terminal’. Now, it showing ‘README.md’ as untracked file in red colour.  Let’s add it, Type ‘git add README.md’ and enter Now again type, ‘git status’,  It show README.md in green colour. Commit/save changes using these command ‘git commit - m “first commit” ‘.  Now it’s showing message file change and insert. If it’s first time, it ask for setup account, Run ‘git config —global —edit’, Uncomment name and email. Enter correct email id. Commit this changes, ‘git commit --amend —reset-author’. Tracking different version, what we have to commit. Run command ‘git log’ If you want to go back to previous version. First run ‘git log command’, after that you got version commit id like this -  a4ce36a523b99e942ad37906122d3eeb44185dd...

Git Lab

Git global setup git config --global user.name "divakar singh" git config --global user.email "divakar1592singh@gmail.com" Create a new repository git clone https://gitlab.com/divakar1592singh/Across.git cd Across touch README.md git add README.md git commit -m "add README" git push -u origin master Existing folder cd existing_folder git init git remote add origin https://gitlab.com/divakar1592singh/Across.git git add . git commit -m "Initial commit" git push -u origin master Existing Git repository cd existing_repo git remote rename origin old-origin git remote add origin https://gitlab.com/divakar1592singh/Across.git git push -u origin --all git push -u origin --tags Some more git pull git push origin --force --all