making changes when you don't have write access
My Repository
on
My GitHub
fork
make your own copy
Your copy of
My Repository
on Your GitHub
Your copy of
My Repository
on your local machine
clone
download your own copy
branch
make a parallel version
A parallel version of Your copy of
My Repository
on your local machine
Modify code
My Repository
on
My GitHub
pull request
ask to change my repository
Your copy of
My Repository
on Your GitHub
push
put changes
on your
GitHub
A parallel version of Your copy of
My Repository
on your local machine
Modify code
add
commit
record changes
merge
pull request
accept change
pull
sync
with
my
repo
My Repository
on
My GitHub
fork
make your own copy
Your copy of
My Repository
on Your GitHub
Your copy of
My Repository
on your local machine
clone
download your own copy
branch
make a parallel version
A parallel version of Your copy of
My Repository
on your local machine
Modify code
My Repository
on
My GitHub
fork
make your own copy
Your copy of
My Repository
on Your GitHub
Your copy of
My Repository
on your local machine
clone
download your own copy
branch
make a parallel version
A parallel version of Your copy of
My Repository
on your local machine
Modify code
this should be your GitHub username
code-review-adass-2023
My Repository
on
My GitHub
fork
make your own copy
Your copy of
My Repository
on Your GitHub
Your copy of
My Repository
on your local machine
clone
download your own copy
branch
make a parallel version
A parallel version of Your copy of
My Repository
on your local machine
Modify code
Old way
doc1.py
doc1_v2.py
make a copy
Challenges:
New way
doc1.py
new
branch
doc1.py
main
branch
doc1.py
doc1.py
doc1.py
New way
doc1.py
new
branch
doc1.py
master
branch
doc1.py
doc1.py
doc1.py
Advantages:
git branch <branch_name>
git checkout <branch_name>
git branch <branch_name>: create a new branch with name <branch_name>
git checkout <branch_name>: move to branch <branch_name>
git branch: list all branches
git branch feature
git checkout feature
git add
git commit
...
git checkout main
git merge feature
doc1.py
feature
branch
doc1.py
main
branch
doc1.py
doc1.py
doc1.py
Bonus:
git branch feature
git checkout feature
git add
git commit
...
git checkout main
git merge feature
My Repository
on
My GitHub
pull request
ask to change my repository
Your copy of
My Repository
on Your GitHub
push
put changes
on your
GitHub
A parallel version of Your copy of
My Repository
on your local machine
Modify code
add
commit
record changes
merge
pull request
accept change
pull
sync
with
my
repo
My Repository
on
My GitHub
pull request
ask to change my repository
Your copy of
My Repository
on Your GitHub
push
put changes
on your
GitHub
A parallel version of Your copy of
My Repository
on your local machine
Modify code
add
commit
record changes
merge
pull request
accept change
pull
sync
with
my
repo
git push -u origin refactor
Exercise #5:
Bonus:
My Repository
on
My GitHub
pull request
ask to change my repository
Your copy of
My Repository
on Your GitHub
push
put changes
on your
GitHub
A parallel version of Your copy of
My Repository
on your local machine
Modify code
add
commit
record changes
merge
pull request
accept change
pull
sync
with
my
repo
Creating a Pull Request
main
...Azalee accepts PR...
My Repository
on
My GitHub
pull request
ask to change my repository
Your copy of
My Repository
on Your GitHub
push
put changes
on your
GitHub
A parallel version of Your copy of
My Repository
on your local machine
Modify code
add
commit
record changes
merge
pull request
accept change
pull
sync
with
my
repo
1. Add an alias for my repository
2. Check aliases
3. Check that you are on your refactor branch
4. Pull down changes from upstream repository*
git remote add upstream https://github.com/abostroem/code-review-2024-06-26-lsst
git remote -v
git branch
git checkout refactor
git pull upstream main
*you may need to resolve conflicts
original
changes from refactor branch
changes from Azalee's main branch
git branch (<branch name>)
git checkout <branch name>
git add <filename>
git commit -m <message>
git pull <alias> <branch>
git push (-u) <alias> <branch>