Github-1 : Basic Setup




Basic Setup


  1. First create a README.md (md = markdown file) from terminal in your git directory
  2. Open README.md file in vim  ‘vim README.md’. Type text, whatever you want like - ###My first title and exit.
  3. Type ‘git status in terminal’. Now, it showing ‘README.md’ as untracked file in red colour. 
  4. Let’s add it, Type ‘git add README.md’ and enter
  5. Now again type, ‘git status’,  It show README.md in green colour.
  6. Commit/save changes using these command ‘git commit - m “first commit” ‘.  Now it’s showing message file change and insert.
  7. If it’s first time, it ask for setup account,
  8. Run ‘git config —global —edit’, Uncomment name and email. Enter correct email id.
  9. Commit this changes, ‘git commit --amend —reset-author’.
  10. Tracking different version, what we have to commit. Run command ‘git log’
  11. If you want to go back to previous version. First run ‘git log command’, after that you got version commit id like this - a4ce36a523b99e942ad37906122d3eeb44185ddc.  Select first 7 character and type this command ‘git checkout a4ce36a
  12. After 11, You can see some message that you are in detached state. Create new branch to retain changes.
  13. Type ‘Git branch’, you see a message -detached state a4ce36a
  14. Now, create new branch. Type ‘git checkout -b my branch’
  15. Now, you checked out and have previous commit. For checkout type ‘vim README.md’. Only one left.
  16. Let’s  add multiple file to git. A. Create multiple file ’touch awesome.js index.html style.css’. B. Now, type ‘git add -A'

Comments

Popular posts from this blog

gitlab-1

Github-2 : Setting Up Github