git_hero_2021's People
Forkers
signior-x kanishk-garg4 ritam727 pushkar-dev metavinayak devprajapat02 optimisticlucifer yuvraj-aseri aryaka-choudhary piyush-1515 ujjawalkhadanga okomk batman14-s code-ash-iit ayushdobal vs424 prashant280920 pratiksha-dse jrijul1201 thedagaboy titiksha-02 saransh0905 vermamohit13 aksy2512 rishabh-792 vishwas-10 vivek9976 lucas-c9 archana00n aryan190902 shivam12-git krishan-er dishti-oberai avnimittal13 upendradwivedi nuapt lavish2210 saikiran0510 sethdivyansh rishang19dxgit_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
- Fork this repo
- Clone the forked repo using
git clone https://github.com/{your-github-username}/git_hero_2021
- Make a new branch with the name
challenge1
usinggit checkout -b challenge1
- Edit the
participants.md
file and add yourself to it likeName (Roll No)
as an exampleAnmol (b19069)
. - Stage the changes using
git add participants.md
- Commit the changes using
git commit -m "{your commit message}"
- Push the changes using
git push origin challenge1
- 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
- Create a new branch
challenge5
- There are three branches,
part1
,part2
andpart3
, each of which have a commitfeature1
,feature2
andfeature3
respectively. - Cherry Pick these commits one by one onto the
challenge5
branch. - 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.
- Create a new branch
challenge2
fromchallenge1
- Add a new remote
upstream
pointing to this repo i.ehttps://github.com/KamandPrompt/git_hero_2021
- Fetch the
version1
branch from upstream. - Now merge the
version1
branch from upstream and merge it with your branch i.echallenge2
- Now check git log. Take screenshots of the logs of last three commits and add them to the report.
- Push the changes to
challenge2
branch and make a pull request with descriptionSolved #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
- Go to main branch
git checkout main
- Create a new branch when you are in the main branch using
git checkout -b bonus2
- Now you will be having the challenge6 branch in the local. so run
git merge challenge6
- You will see that a merge conflict has appeared. Your task is to keep the changes with your name.
- 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 ;)
- Create a new branch
challenge3
- 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 examplegit rebase -i HEAD~2
,git rebase -i HEAD~4
- Now git log and add take a screenshot to have it in the report.
- 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
- Create a new branch
challenge6
- Take a look at it's
git log
, and attach as screenshot in the report. You can see 2 commits by the namesbug1
andbug2
- 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:
- Reset the last commit using
git reset HEAD~1
. This has uncommitted the last commit. Now check git status. - 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.
- After stashing, you can check for using
git status
. git status is a real friend of yours. - 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.
- Create a branch named
bonus1
. - Fetch and hard reset all the commits from the upstream main branch.
- 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.