Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imposed master branch #348

Merged
merged 55 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
62edc36
fix(commit.rb): explicitly define branch as master
nbehrnd Apr 8, 2024
dc3ba9a
style(config.rb): edit description of task ahead
nbehrnd Apr 17, 2024
949bb9e
fix(add.rb): explicitly define branch as master
nbehrnd Apr 17, 2024
5278bbc
style(clone_to_folder): edit description of the task ahead
nbehrnd Apr 17, 2024
38f8c19
fix(ignore.rb): explicitly define branch as master
nbehrnd Apr 17, 2024
9cc53a8
fix(include.rb): explicitly define branch as master
nbehrnd Apr 17, 2024
0ef4151
fix(status.rb): explicitly define branch as master
nbehrnd Apr 17, 2024
26ce22c
fix(number_of_files_committed): explicitly use master branch
nbehrnd Apr 17, 2024
f7764b5
fix(rm.rb): explicitly define branch as master
nbehrnd Apr 17, 2024
8b8da75
fix(rm_cached.rb): explicitly defbe branch as master
nbehrnd Apr 17, 2024
e06a1a5
fix(stash.rb): explicitly define branch as master
nbehrnd Apr 17, 2024
95a6041
fix(rename.rb): explicitly define branch as master
nbehrnd Apr 17, 2024
7d4cdaf
fix(restructure.rb): explicitly use master branch
nbehrnd Apr 17, 2024
1852203
fix(log.rb): explicitly use master branch
nbehrnd Apr 17, 2024
e713bbf
fix(tag.rb): explicitly use master branch
nbehrnd Apr 17, 2024
665d912
fix(push_tags.rb): explicitly use master branch
nbehrnd Apr 17, 2024
ef73a39
fix(commit_amend.rb): explicitly use master branch
nbehrnd Apr 17, 2024
d6c9656
fix(commit_in_future.rb): explicitly use master branch
nbehrnd Apr 17, 2024
aca9f70
fix(reset.rb): explicitly use master branch
nbehrnd Apr 17, 2024
158e6e6
fix(reset_soft.rb): explicitly use master branch
nbehrnd Apr 17, 2024
b7648b8
fix(checkout_file.rb): explicitly use master branch
nbehrnd Apr 17, 2024
c44ebdd
fix(remote.rb): explicitly use master branch
nbehrnd Apr 17, 2024
285fdb9
fix(remote_url.rb): explicitly use master branch
nbehrnd Apr 17, 2024
321c67e
fix(pull.rb): explicitly run branch master
nbehrnd Apr 17, 2024
8fe0c5e
fix(remote_add.rb): explicitly use branch master
nbehrnd Apr 17, 2024
593e972
fix(push.rb): explicitly run branch master
nbehrnd Apr 18, 2024
400359f
fix(diff.rb): explicitly use branch master
nbehrnd Apr 18, 2024
7efd605
fix(blame.rb): explicitly use branch master
nbehrnd Apr 18, 2024
605c2e1
fix(branch.rb): explicitly use branch master
nbehrnd Apr 18, 2024
2f0141b
fix(checkout.rb): explicitly use branch master
nbehrnd Apr 18, 2024
1ebef48
fix(checkout_tag.rb): explicitly use branch master
nbehrnd Apr 21, 2024
1183c19
fix(checkout_tag_over_branch.rb): explicitly use branch master
nbehrnd Apr 21, 2024
1c73673
fix(branch_at.rb): explicitly run branch master
nbehrnd Apr 21, 2024
e1172dd
fix(delete_branch.rb): explicitly run branch master
nbehrnd Apr 21, 2024
1d34349
fix(push_branch.rb): explicitly run branch master
nbehrnd Apr 21, 2024
13dfbf7
fix(merge.rb): explicitly run branch master
nbehrnd Apr 21, 2024
cd36f76
fix(fetch.rb): explicitly run branch master
nbehrnd Apr 21, 2024
59fc038
fix(rebase.rb): explicitly run branch master
nbehrnd Apr 21, 2024
347174c
fix(rebase_onto.rb): explicitly run branch master
nbehrnd Apr 21, 2024
9df68f0
fix(repack.rb): explicitly run branch master
nbehrnd Apr 21, 2024
acf3611
fix(cherry-pick.rb): explicitly run branch master
nbehrnd Apr 21, 2024
9c6e46f
fix(grep.rb): explicitly run branch master
nbehrnd Apr 21, 2024
c932283
fix(rename_commit.rb): explicitly run branch master
nbehrnd Apr 21, 2024
9958594
fix(squash.rb): explicitly run branch master
nbehrnd Apr 21, 2024
6eb67dc
fix(merge_squash.rb): explicitly run branch master
nbehrnd Apr 21, 2024
b576c5b
fix(reorder.rb): explicitly run branch master
nbehrnd Apr 21, 2024
275c6ad
fix(bisect.rb): explicitly run branch master
nbehrnd Apr 21, 2024
8a15a16
fix(stage_lines.rb): explicitly run branch master
nbehrnd Apr 21, 2024
eb7c007
fix(find_old_branch.rb): explicitly run branch master
nbehrnd Apr 21, 2024
09fbafd
fix(revert.rb): explicitly run branch master
nbehrnd Apr 21, 2024
9b9a0a3
fix(restore.rb): explicitly run branch master
nbehrnd Apr 21, 2024
675fac2
fix(conflict.rb): explicitly run branch master
nbehrnd Apr 21, 2024
33fcbc5
fix(submodule.rb): explicitly run branch master
nbehrnd Apr 21, 2024
dcbe5d3
style(rm.rb): edit internal task description
nbehrnd Apr 21, 2024
1266b29
style(push_tags.rb): edit internal task description
nbehrnd Apr 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions levels/add.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
difficulty 1
description "There is a file in your folder called `README`, you should add it to your staging area
Note: You start each level with a new repo. Don't look for files from the previous one."
description "There is a file in your folder called `README`; add it to your staging area.
Note: Each level starts with a new repo. Don't look for files of the previous one."

setup do
repo.init
FileUtils.touch("README")
system "git branch -m master"
end

solution do
Expand Down
3 changes: 2 additions & 1 deletion levels/bisect.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
difficulty 3
description "A bug was introduced somewhere along the way. You know that running `ruby prog.rb 5` should output 15. You can also run `make test`. What are the first 7 chars of the hash of the commit that introduced the bug."
description "A bug was introduced somewhere along the way. You know that running `ruby prog.rb 5` should output 15. You can also run `make test`. What are the first 7 chars of the hash of the commit (the abbreviated hash) that introduced the bug?"

setup do
init_from_level
repo.init
system "git branch -m master"
end

solution do
Expand Down
3 changes: 2 additions & 1 deletion levels/blame.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
difficulty 2
description "Someone has put a password inside the file `config.rb` find out who it was."
description "Identify who put a password inside the file `config.rb`."

setup do
init_from_level
system "git branch -m master"
end

solution do
Expand Down
3 changes: 2 additions & 1 deletion levels/branch.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
difficulty 1
description "You want to work on a piece of code that has the potential to break things, create the branch test_code."
description "To work on a piece of code that has the potential to break things, create the branch test_code."

setup do
repo.init
FileUtils.touch("README")
repo.add "README"
repo.commit_all("Initial commit")
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/branch_at.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
File.open("file1", 'a') { |f| f.write("\nAdding some more text") }
repo.add("file1")
repo.commit_all("Updating file1 again")
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/checkout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
FileUtils.touch("README")
repo.add("README")
repo.commit_all("initial commit")
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/checkout_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
File.open("config.rb", "a") do |file|
file.puts("These are changed you don't want to keep!")
end
system "git branch -m master"
end

solution do
Expand Down
2 changes: 2 additions & 0 deletions levels/checkout_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
repo.add("app.rb")
repo.commit_all("Changes galore")
repo.git.tag( { 'f' => true }, "v1.5" )

system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/checkout_tag_over_branch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
FileUtils.touch("app.rb")
repo.add("app.rb")
repo.commit_all("Initial commit")
system "git branch -m master"

`echo "Some code" >> app.rb`
repo.add("app.rb")
Expand Down
5 changes: 3 additions & 2 deletions levels/cherry-pick.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
description "Your new feature isn't worth the time and you're going to delete it. But it has one commit that fills in `README` file, and you want this commit to be on the master as well."

setup do
init_from_level
`git stash` # fix for README.md being in githug root an the level
init_from_level
`git stash` # fix for README.md being in githug root an the level
system "git branch -m master"
end

solution do
Expand Down
2 changes: 1 addition & 1 deletion levels/clone_to_folder.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
difficulty 1
description "Clone the repository at https://github.com/Gazler/cloneme to `my_cloned_repo`."
description "Clone the repository at https://github.com/Gazler/cloneme into the folder `my_cloned_repo`."

solution do
repo("my_cloned_repo").commit("157b2b61f29ab9df45f31c7cd9cb5d8ff06ecde4")
Expand Down
1 change: 1 addition & 0 deletions levels/commit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

setup do
repo.init
system "git branch -m master"
FileUtils.touch("README")
repo.add("README")
end
Expand Down
1 change: 1 addition & 0 deletions levels/commit_amend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
repo.add("README")
repo.commit_all("Initial commit")
FileUtils.touch("forgotten_file.rb")
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/commit_in_future.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

FileUtils.touch("README")
repo.add("README")
system "git branch -m master"
end

solution do
Expand Down
2 changes: 1 addition & 1 deletion levels/config.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
difficulty 1
description "Set up your git name and email, this is important so that your commits can be identified."
description "Set up your git name and email; this is important so that your commits can be identified."

setup do
repo.init
Expand Down
1 change: 1 addition & 0 deletions levels/conflict.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

setup do
init_from_level
system "git branch -m master"
end

solution do
Expand Down
5 changes: 3 additions & 2 deletions levels/delete_branch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
description "You have created too many branches for your project. There is an old branch in your repo called 'delete_me', you should delete it."

setup do
init_from_level
init_from_level
system "git branch -m master"
end

solution do
Expand All @@ -12,4 +13,4 @@

hint do
puts "Running 'git --help branch' will give you a list of branch commands."
end
end
3 changes: 2 additions & 1 deletion levels/diff.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
difficulty 2
description "There have been modifications to the `app.rb` file since your last commit. Find out which line has changed."
description "Since your last commit, file `app.rb` was modified. Find out which line has changed."

setup do
init_from_level
system "git branch -m master"
end

solution do
Expand Down
9 changes: 5 additions & 4 deletions levels/fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# local repo
repo.init
system "git branch -m master"

# adds a file to origin/master
FileUtils.touch "master_file"
Expand Down Expand Up @@ -51,16 +52,16 @@
# after a git fetch command, each branch will be stored in in the .git/FETCH_HEAD file. Each branch is on its own line
# This command will count the number of lines, which will give the number of branches
if File.file?('.git/FETCH_HEAD') # checks for file existence
num_remote = File.read(".git/FETCH_HEAD").split("\n").count
num_remote = File.read(".git/FETCH_HEAD").split("\n").count
else
num_remote = 0
num_remote = 0
end

# there should be 1 local branch and 2 remote branches for a success condition
if local_branches == 1 and num_remote == 2
result = true
result = true
else
result = false
result = false
end
end

Expand Down
1 change: 1 addition & 0 deletions levels/find_old_branch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

setup do
init_from_level
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/grep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

setup do
init_from_level
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/ignore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
setup do
repo.init
FileUtils.touch("README.swp")
system "git branch -m master"
file = File.open(".git/config", "w") do |file|
file.puts "[core]\nexcludesfile="
end
Expand Down
1 change: 1 addition & 0 deletions levels/include.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
FileUtils.touch("first.a")
FileUtils.touch("second.a")
FileUtils.touch("lib.a")
system "git branch -m master"
file = File.open(".git/config", "w") do |file|
file.puts "[core]\nexcludesfile="
end
Expand Down
3 changes: 2 additions & 1 deletion levels/log.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
difficulty 2

description "Find out what the hash of the latest commit is."
description "Identify the hash of the latest commit."

setup do
repo.init
file = File.new("newfile.rb", "w")
repo.add("newfile.rb")
repo.commit_all("THIS IS THE COMMIT YOU ARE LOOKING FOR!")
system "git branch -m master"
end

solution do
Expand Down
7 changes: 4 additions & 3 deletions levels/merge.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
difficulty 2
description "We have a file in the branch 'feature'; Let's merge it to the master branch."
description "We have a file in the branch 'feature'. Let's merge it with the master branch."

setup do
init_from_level
init_from_level
system "git branch -m master"
end

solution do
File.exists?("file1") && File.exists?("file2")
File.exists?("file1") && File.exists?("file2")
end

hint do
Expand Down
1 change: 1 addition & 0 deletions levels/merge_squash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
FileUtils.touch "file1"
repo.add "file1"
repo.commit_all "First commit"
system "git branch -m master"

repo.git.native :checkout, {"b" => true}, 'long-feature-branch'
File.open("file3", 'w') { |f| f << "some feature\n" }
Expand Down
5 changes: 3 additions & 2 deletions levels/number_of_files_committed.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
difficulty 1
description "There are some files in this repository, how many of the files are staged for a commit?"
description "There are some files in this repository; how many of them are staged for a commit?"

setup do
repo.init
Expand All @@ -8,6 +8,7 @@
%w{rubyfile4.rb rubyfile5.rb}.each do |file|
FileUtils.touch(file)
repo.add(file)
system "git branch -m master"
end
repo.commit_all "Commit"

Expand Down Expand Up @@ -47,5 +48,5 @@
end

hint do
puts "You are looking for a command to identify the status of the repository, (resembles a linux command)."
puts "You are looking for a command to identify the status of the repository (resembles a Linux command)."
end
1 change: 1 addition & 0 deletions levels/pull.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
setup do
repo.init
repo.remote_add("origin", "https://github.com/pull-this/thing-to-pull")
system "git branch -m master"
end

solution do
Expand Down
2 changes: 2 additions & 0 deletions levels/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
FileUtils.touch "file3"
repo.add "file3"
repo.commit_all "Third commit"
system "git branch -m master"

# remote repo
Dir.chdir tmpdir
Expand All @@ -39,6 +40,7 @@
FileUtils.touch "file4"
repo.add "file4"
repo.commit_all "Fourth commit"
system "git branch -m master" # tentative addition

# change back to original repo to set up a remote
Dir.chdir cwd
Expand Down
1 change: 1 addition & 0 deletions levels/push_branch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
FileUtils.touch "file1"
repo.add "file1"
repo.commit_all "committed changes on master"
system "git branch -m master"

# copy the repo to remote
FileUtils.cp_r ".", tmpdir
Expand Down
3 changes: 2 additions & 1 deletion levels/push_tags.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
difficulty 2
description "There are tags in the repository that aren't pushed into remote repository. Push them now."
description "A tag in the local repository isn't pushed into remote repository. Push it now."

setup do
# remember the working directory so we can come back to it later
Expand All @@ -14,6 +14,7 @@
repo.add "file1"
repo.commit_all "First commit"
repo.git.tag({'f' => true}, "tag_to_be_pushed")
system "git branch -m master"

FileUtils.touch "file2"
repo.add "file2"
Expand Down
1 change: 1 addition & 0 deletions levels/rebase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

setup do
init_from_level
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/rebase_onto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
File.open(authors_file, "w") { |f| f << "https://github.com/janis-vitols\n" }
repo.add(authors_file)
repo.commit_all("Create authors file")
system "git branch -m master"

repo.git.native :checkout, { "b" => true }, "wrong_branch"
File.open(authors_file, "w") { |f| f << "None\n" }
Expand Down
1 change: 1 addition & 0 deletions levels/remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
setup do
repo.init
repo.remote_add("my_remote_repo", "https://github.com/Gazler/githug")
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/remote_add.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

setup do
repo.init
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/remote_url.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
repo.init
repo.remote_add("my_remote_repo", "https://github.com/Gazler/githug")
repo.remote_add("remote_location", "https://github.com/githug/not_a_repo")
system "git branch -m master"
end

solution do
Expand Down
1 change: 1 addition & 0 deletions levels/rename.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
FileUtils.touch("oldfile.txt")
repo.add("oldfile.txt")
repo.commit_all("Commited oldfile.txt")
system "git branch -m master"
end

solution do
Expand Down
Loading