Skip to content

Latest commit

 

History

History
72 lines (58 loc) · 1.77 KB

steps-1.md

File metadata and controls

72 lines (58 loc) · 1.77 KB

Local Repo

  1. Install git: Git website

  2. git bash

  3. Configure git:

    git config --global user.name "Samir Aly"
    git config --global user.email "[email protected]"
    git config --global core.editor /path/to/editor
    
  4. mkdir repo10

  5. cd repo10

  6. git init

  7. touch index.html

  8. edit and save file

  9. git add index.html

  10. git commit -m "Add new index file"

  11. git log

  12. git log --stat

  13. git log --pretty=oneline

  14. git log -n 4

  15. To stage and commit in one step: git commit -a -m "Message"

  16. git show a59z

  17. git diff a59z b3eer

  18. git checkout a59z

  19. git checkout master


Preparing a remote repo on github:

  1. create new repo on github
  2. create ssh key pair (public + private) https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent ssh-keygen -t rsa -b 4096 -C "[email protected]"
  3. upload public key to github cat ~/.ssh/keyname.pub
  4. define private key to local repo eval $(ssh-agent -s) ssh-add ~/.ssh/keyname
  5. Define remote repo: git remote add origin [email protected]:username/repo-name.git
  6. git push -u origin master

Adding a team member

  1. go to repo settings on github

  2. Click Collaborators

  3. Add username of new team member

  4. new member should accept invitation

  5. new member should create a private/public key pair and add public key to his github account.

  6. create a new working directory

  7. enter directory and run command:

    git clone repo-url .
    
  8. start editing files

  9. git commit -a -m "New message"

  10. git push -u origin master


Other team members

git pull