This is an individual lab in a group. You do the labs on your local machine and help each other.
Account in Github git
- Make a pull request on a repository in Github
Github git
- Create a Github account
Guide to creating Github account
- Visit
https://github.com/maiyuki/linux2-git
in your web browser - Do a fork and wait a few seconds until it is done.. (See the Notes below about Fork)
- Visit the forked repository in your GitHub account
https://github.com/<your-username>/linux2-git
and you should see that you have a copy oflinux2-git
repository in your Github account.
- Clone this repository from YOUR Github account to your local machine
- In your terminal, checkout to a new branch
- Add a file in the directory
linux2-git/2-pull-request//
- Add file to index
- Make a commit
- Make a push (which is in your Github account)
- (a message on the terminal will pop up:)
fatal: The current branch <your-new-branch-name> has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin <your-new-branch-name>
- Set remote as upstream
- Go immediately to
https://github.com/<your-username>/linux2-git
after you have made a push and press the green buttonCompare & pull
(it disappears after a while) - In the
Comparing changes
stage. Make sure thatcompare:<your-new-branch-name>
is merging tobase:main
. Create a pull request. - Merge into master/main branch
- Go back to your repository (
https://github.com/<your-username>/linux2-git
) Do aPull request
and that will create a pull request tohttps://github.com/maiyuki/linux2-git
- Wait for approval..
git init
git status
git commit
git checkout
git add
git diff
git branch
git merge
git push # this is a new command for this lab
git reset
git help
-
Visit
https://github.com/maiyuki/linux2-git
in your web browser -
Do a fork and wait a few seconds until it is done.. (See the Notes below about Fork)
- Visit the forked repository in your GitHub account
https://github.com/<your-username>/linux2-git
and you should see that you have a copy oflinux2-git
repository in your Github account.
- Clone this repository from YOUR Github account to your local machine
git clone https://github.com/<your-username>/linux2-git
- In your terminal, checkout to a new branch
git checkout -b <your-new-branch-name>
- Add a file in the directory
linux2-git/2-pull-request/ADD-YOUR-FILE-HERE/
touch hello-world.txt
- Add file to index
git add .
- Make a commit
git commit -m "My hello world file"
- Make a push (which is in your Github account)
git push
- (a message on the terminal will pop up:)
fatal: The current branch <your-new-branch-name> has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin <your-new-branch-name>
- Set remote as upstream
git push --set-upstream origin <your-new-branch-name>
- Go immediately to
https://github.com/<your-username>/linux2-git
after you have made a push and press the green buttonCompare & pull
(it disappears after a while)
- In the
Comparing changes
stage. Make sure thatcompare:<your-new-branch-name>
is merging tobase:main
. Create a pull request.
-
Merge into master/main branch - click on merge button
-
Go back to your repository (
https://github.com/<your-username>/linux2-git
) Do aPull request
and that will create a pull request tohttps://github.com/maiyuki/linux2-git
- Wait for approval.. (you are done)
Fork: When you are working in your project groups. You should not use a fork. Just clone from the group's repository. The fork is only for the lab to work.