Code Monkey home page Code Monkey logo

git_hero_2021's People

Contributors

signior-x avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

git_hero_2021's Issues

Challenge 1

Hope you read the plot. We want to have the names of all those who are ready to help the DehlaPakad team.

In this challenge, you will learn the most basic git workflow i.e forking a repository, making a clone, making changes and making a pull request. Here are the tasks

  1. Fork this repo
  2. Clone the forked repo using git clone https://github.com/{your-github-username}/git_hero_2021
  3. Make a new branch with the name challenge1 using git checkout -b challenge1
  4. Edit the participants.md file and add yourself to it like Name (Roll No) as an example Anmol (b19069).
  5. Stage the changes using git add participants.md
  6. Commit the changes using git commit -m "{your commit message}"
  7. Push the changes using git push origin challenge1
  8. Make a pull request from github. In the pull request description, write 'Solved #1'

TIP : Write proper commit messages for more marks.

Challenge 5

Priyam has hidden some assets in some other branches due to which the game is not able to run. Pranshu found the branches and the commits where the necessary work is there. Help the Team to run the game.

In this challenge, you will learn about Cherry-Pick which is a command used to pick commits from a different branch onto your current branch.
The tasks you have to do are

  1. Create a new branch challenge5
  2. There are three branches, part1, part2 and part3, each of which have a commit feature1 , feature2 and feature3 respectively.
  3. Cherry Pick these commits one by one onto the challenge5 branch.
  4. Push the changes and create a Pull Request with the description Solved #5

HINT:
The length commit hash may be useful.

Challenge 2

Priyam and Pranshu are smart. They have added the assets and sounds which are necessary on the version1 branch. The head of version1 is thus three commits ahead of the main. Your task is as follows.

In this challenge, you will learn about git pull and the concept of remotes in git. Btw, we are done giving you exact commands. Now google is your friend.

  1. Create a new branch challenge2 from challenge1
  2. Add a new remote upstream pointing to this repo i.e https://github.com/KamandPrompt/git_hero_2021
  3. Fetch the version1 branch from upstream.
  4. Now merge the version1 branch from upstream and merge it with your branch i.e challenge2
  5. Now check git log. Take screenshots of the logs of last three commits and add them to the report.
  6. Push the changes to challenge2 branch and make a pull request with description Solved #2

HINTS
Here are the commands you will need for these tasks. Read their documentations and do accordingly

2 : git remote
3 : git fetch
4 : git merge
5 : git log

Bonus2

No marks for Bonus Ones
Conflict resolution!

This Task Can only be done after doing challenge6

  1. Go to main branch git checkout main
  2. Create a new branch when you are in the main branch using git checkout -b bonus2
  3. Now you will be having the challenge6 branch in the local. so run git merge challenge6
  4. You will see that a merge conflict has appeared. Your task is to keep the changes with your name.
  5. Finally resolve the conflict, add commit and make a PR.

SUBMISSION

Make a new branch with the name submission. from the main branch.

Add the report.txt, report.md, etc etc in that and make a PR.
The name of the submission should be

RollNO_Name_Report.txt or whatever the extension is. Just the name should be like this.

Challenge 3

The commits help keep a record of the work. Thus the commits should be proper and multiple commits for the same work should be discouraged. Help the team to have a more clear commit history.

In this challenge, you will learn the concept of squashing commits and using rebase. Lesser hints will be available from now on ;)

  1. Create a new branch challenge3
  2. Squash the last four commits into a single commit using the command git rebase -i HEAD~{some-number} Think of this some number... this will varry. for example git rebase -i HEAD~2, git rebase -i HEAD~4
  3. Now git log and add take a screenshot to have it in the report.
  4. Push the changes and make a pull request using the description Solved #3

Hint : You may read about squashing commits using interactive rebase.
You will be need to change three picks to squash.
You may enter into Vim while rebasing. It is hard to get out of it :P

Challenge 6

We submitted the game to the DehlaPakad Team. Now the game can be run, but it crashes as soon as one loses. Sarthak is still upset as he has so many friends to play the game with that he can not afford to restart the whole game again and again. Pranshu and Priyam were not saying a single word about this issue. But their friend Parshva saw the commit history and found the problem in minutes. He found that the two commits were introduced as bugs intentionally by Priyam and Pranshu. Parshva discussed this with Divyasheel and found a way to solve this.

In this challenge, you are going to learn how to delete random commits.
Here are the tasks

  1. Create a new branch challenge6
  2. Take a look at it's git log, and attach as screenshot in the report. You can see 2 commits by the names bug1 and bug2
  3. These commits are bugs in the code, and need to be removed. Remove these commits from the commit history.

Congratulations. You have now successfully created assembled a game. Type these commands and enjoy the game.
pip install -r pygame
python spaceShooter.py

Don't forget to attach a screenshot of the game in the final report ;)

HINT :
You may use git rebase along with drop to delete the commits.

Challenge 4

"Ha Ha Ha... so you tackled all the previous challenges, but this one is going to be your last :P" - Priyam
"Nothing is Impossible" - The Team

In this Challenge, you will learn about git reset and git stash.

To get started for this challenge first create a new branch challenge4 using git checkout -b challenge4.
Now, The task you need to do is to add a commit before the last commit. So, how to do this? There can be many ways to achieve this. One easy technique can be this:

  1. Reset the last commit using git reset HEAD~1. This has uncommitted the last commit. Now check git status.
  2. Observe, these changes will be needed in the future. However, you currently want to set aside these changes so you can focus on a new task. Show use git stash to save the current changes. After stashing do check git status.
  3. After stashing, you can check for using git status. git status is a real friend of yours.
  4. In the spaceShooter.py file, these are the lines 24 and 25
# img_dir = path.join(path.dirname(__file__), 'assets')
# sound_folder = path.join(path.dirname(__file__), 'sounds')

Uncomment these two lines, and then add and commit. This commit should only be having these changes
After you have committed this change, do git log and git status. These will be needed in the report.
5. Pop the stashed changes, and then add the changes and commit them.
6. Now push the changes and make a PR from the challenge4 branch.

HINT:
Take care of the changes done while committing anything. git status will be really helpful.

Bonus 1

Let's see tomorrow, will the DehlaPakad team be able to enjoy the game or not. It's in the hands of IIT Mandi freshers. Wait, but why are you here.... oh so to just have fun :P
Adieu!

No Marks are for Bonus Ones
These are just for Practice may be tough, tricky, or maybe easy for some.

  1. Create a branch named bonus1.
  2. Fetch and hard reset all the commits from the upstream main branch.
  3. Now squash all the commits into a single commit and make a PR.

Hint: It is not so easy as it seems :P

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.