-
Install git: Git website
-
git bash
-
Configure git:
git config --global user.name "Samir Aly" git config --global user.email "[email protected]" git config --global core.editor /path/to/editor
-
mkdir repo10
-
cd repo10
-
git init
-
touch index.html
-
edit and save file
-
git add index.html
-
git commit -m "Add new index file"
-
git log
-
git log --stat
-
git log --pretty=oneline
-
git log -n 4
-
To stage and commit in one step:
git commit -a -m "Message"
-
git show a59z
-
git diff a59z b3eer
-
git checkout a59z
-
git checkout master
- create new repo on github
- 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]"
- upload public key to github
cat ~/.ssh/keyname.pub
- define private key to local repo
eval $(ssh-agent -s)
ssh-add ~/.ssh/keyname
- Define remote repo:
git remote add origin [email protected]:username/repo-name.git
git push -u origin master
-
go to repo settings on github
-
Click Collaborators
-
Add username of new team member
-
new member should accept invitation
-
new member should create a private/public key pair and add public key to his github account.
-
create a new working directory
-
enter directory and run command:
git clone repo-url .
-
start editing files
-
git commit -a -m "New message"
-
git push -u origin master
git pull