- Purpose
Add my code to my teammate's code.
- My teammate's code
- My code
- Add my code to my teammate's code.
- Step
1. git branch
(In order to merge to the master)
Create branch, default is main.
Once new branch created, it appears below main.
The one with * at the front is the currently selected branch.
% git branch recommend_item
% git branch
>>>
* main
recommend_item
2. switch to the branch
% git switch recommend_item
>>>
Switched to branch 'recommend_item'
Your branch is up to date with 'origin/recommend_item'.
3. clone
Clone my teammate's code.
Format example : git clone https://mellamonaranja:PERSONAL_ACCESS_TOCKEN@github.com/illunex/abc_food_api_server.git
4. add
Add my code.
5. commit
6. push
tips
- Check occasionally the status, configure.
git status
git config --list
git config
git remote remove origin
ls -al
- Working Directory : the directory where my code is
- Staging Area : Space where files are gathered to commit after 'git add'
- Repository : Storage where commits are gathered
- Untracked : Compare with my working directory and git, files only in my working directory
- Unmodified : When file is newly added after 'git add'
- Modified : File modified after 'git add'
reference : https://iseunghan.tistory.com/322
'Git' 카테고리의 다른 글
When git doesn't push at last step(Could not read from remote repository) (0) | 2024.01.17 |
---|---|
Push files to github with Personal access tokens (0) | 2022.06.15 |
git error : src refspec master does not match any (0) | 2022.06.15 |
git error : Permission denied (publickey) (0) | 2022.04.06 |
git error : Updates were rejected because the tip of your current branch is behind (0) | 2021.11.18 |