GIT - 29 August ' 23
Published: 2023-09-03 04:28:24

## **<u>_COLLABORATOR_</u>**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0bcf23725hyn7icfucie.png)

1. Create a Repository and clone from your local.
2. URL can be taken from the code tab and opt for HTTPS URL.
3. Add a file in the local.
4. commit the file with the message.
5. Push to the Repository from Stage ( which is in Local )

```
git clone https://github.com/technonotes-hacker/git-demo.git
cd git-demo/
git status ( If its in RED color then Stage area உள்ள போகவே இல்லை ,  அதே GREEN  இருந்தா STAGE area  உள்ள போயிடுச்சுன்னு அர்த்தம் )
Now GIT will start tracking all changes.
git commit -m "this is my first commit in apple file"
git push origin main
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ualwdv0uqh1wbuoah4vy.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xr6azi2b89aif38jbbyh.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9i65oo9ikzfeuxt9myzb.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ysw6kjvc1ackaxllho6u.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t2twtq8sa67spucvofdz.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa0i07h4mhpvzf4l8bnt.png)

_<u>Now create a collaborator,</u>_

```
settings > Collaborators > Add people
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9jxr1dnqqk63k2wb0ej.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqqi59xr4w2wfl48dmtt.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/49hz38o180akvqth882n.png)

_<u>
User will receive an e-mail</u>_ ,

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ejohxragkey79c3od88.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p93paaxhbl3ooxemmily.png)

Owner is : **_technonotes-hacker_** but the owner has given some access to the other collaborator. Now the user i.e the collaborator accepted the invite and started to clone and add a file.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zh001tc8umwt29lr1u0m.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8u7uzakm45ckqj3ekobq.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bbboof43qz8i702sibiu.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8l5t35mjawgvqxqhflrp.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wv73rid9mzbs14iyzjnk.png)

Collaborator create பண்ண file  இங்க வந்துடுச்சு ,  இந்த login collaboratorஓடது .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r5daf02asauk87ynxpry.png)

Now the file came to the OWNER, but won't be visible in his local i.e laptop.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rycfo2fgq3zautdte9u3.png)

இப்ப pull பண்ணதும் Mango file  இங்க வந்துடுச்சு ,  இதை யாருக்கு create  பண்ணான்னு ஞாபகம்  இருக்கு இல்ல i.e Collaborator user.

```
git pull origin main
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f7jvhpbz19xa82r8cig8.png)

Both owner & collaborator can change the files , its like MUTUAL understanding. Even we can merge after making all changes between them.

Also , as you are the collaborator you can fork any Repository BUT keep in mind . Can we edit or change any file ? Lets see 
இத்தனை Repo technonotes-hacker create பண்ணது ,  இத நம்ம fork  பண்றோம் .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/etc38qomp3f5f1fg0lw2.png)

இப்ப நான் இத வந்து fork பண்ண போறேன் project5 ,

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hg2al9jmdap1zxh7uvn6.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5i0xwsfu64ro7si9t0dj.png)

இந்த project5 collaboratorகு வந்துடுச்சு,இதுல நம்ம change பண்ண பாப்போம்.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1ch9xt1bcr4n23llpg6.png)

Change/create file பண்ணலாம்  ஆனா OWNERகு reflect  ஆகாது .  Correct தானே ,  எப்படி ?  நீங்கமாட்டேன்னு fork பண்ணிடுவீங்க அதுக்கப்புறம் changeசஸ் பண்ணுவீங்க ,  அப்புறம் எப்படி இந்த original code maintain பண்ண முடியும். So for that Collaborator will request to the OWNER , these are the changes please accept it. இந்த changes எல்லாம் நான் பண்ணி இருக்கேன்  வேணும்னா accept  பண்ணுங்க.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdpp7q7gxiytwvb2zah4.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v13qur00kawkd5dapbjs.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/18rz9esmblzxzz6vxluk.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qzgj4ff7v4bi1zoqp7o1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/76qx1b5jvcyqa6jy1r09.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wt8xwwkw50wm2a6li5yr.png)

நல்லா பாருங்க below screenshot இவர்தான் OWNER ,  இங்க அந்த file  இல்ல பாத்தீங்களா ?  அந்த manago file  இங்க இருக்காது .  புரியுதா ?  சிம்பிளா சொல்லனும்னா collaborator create பண்ணிட்டாரு OWNERகு அது தெரிய வராது .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rg8jktyj2amtzuwv31em.png)

Now we need to create pull request to the OWNER saying " so and so things are carried out in this project5 ". 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/869yezju0umc6duh6s4m.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zub4ccnklifa30mpmctm.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0tbwy49fyen35v8ayy8f.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n25si73sqv1790wdvcu6.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6hi0ev43ptnsi5le1b0.png)

The owner will receive a mail like this with the commit ID. A pull request.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qzgu8n08ngq3znvoqxc1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/im5msfkyozpvg9lunvm0.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2i5v9utekci78in9guwv.png)

Accepting it , CONFIRM MERGE .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vfnmq23te2m9z5v6r3cn.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dgfusg5m5sy0wb0yhcwd.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nwt0tjqf2iqo8hlelcgx.png)

File came to GIT but local copy இன்னும் வரல . So என்ன பண்ணனும் ? Same process again , 

Below screenshotல, banana file இருக்காது. PR  பண்ணதும்  அந்த பைல் இங்கே வந்துரும்
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/casx4qnk3via3eu0ht02.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mxl3l2o4xwanxyvgumur.png)

---


## **<u>_Important Notes :_</u>**


 
1.Always create a GIT repository only with the "+" symbol,

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dnp9f8rcsmw963wwkvjl.png)

 
2.Don't forget to add the README file which is a good practice ,

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yqyn9f5vd2eesuqd8689.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q2xowoj8s1ecklcjatjy.png)

3.Repository can be created only in the Browser.

4.How to create a Personal access tokens for the logins?

```
Settings > Developer Settings > Personal access tokens (classic)
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r04z26fmsngf22weuun4.png)


5.One question may arise why this option is required ?
Its like a closed team may work on a specific project , so create as collaborator so that you can review and then commit to that particular branch.

6.PR is nothing but PULL REQUEST.