Page 1 of 1

I need help with github

PostPosted: Thu Jan 26, 2017 03:28
by BBmine
Hello, here's the problem: Due to a messup in a commit, something (either github or my local copy) thinks that the files I want to push to github are already there, even though they're just on the local copy. This is the repo in question: https://github.com/BBmine/noob_academy.

I'm kind of a noob at github, so please tell me how to do what I need to do.

Re: I need help with github

PostPosted: Thu Jan 26, 2017 05:06
by octacian
If I understand correctly, you're saying that GitHub won't accept the commit(s) that you are trying to push because it thinks they are already there? If so, do:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
git push origin +master


(Where origin is the name of the remote)

Essentially, the above forces the commit(s) to be pushed no matter what. Hope that helps!

Re: I need help with github

PostPosted: Thu Jan 26, 2017 06:24
by kaeza
Force-pushing to a repo should only be used if strictly necessary as you may break stuff.

BBmine: Can you say which steps are you performing, and any actual error messages you get? Don't paraphrase. Either copy/paste or take a screenshot.

Re: I need help with github

PostPosted: Thu Jan 26, 2017 14:06
by BBmine
cd git_repo
git add --all
git commit -m "message"
"nothing to commit, working tree clean"
git push --all
"Everything up-to-date"
ls
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
3d_armor                 farming             na
admin_tools              fire                nametag_color
advtrains                frisk               otherblocks_2016_03_17
afkkick                  give_initial_stuff  pathv6alt
alias                    homedecor_modpack   playertools
banner                   inventory_plus      protector
basic_machines           jdukebox            signs_lib
bedrock2                 kpgmobs             simple_skins
bees                     lantern             smartshop
bmail                    letters             spawn
bones                    mail                teleports
bridgetool               mapfix              timer_shutdown
carbone_torches          mese_crystals       tools_obsidian
cblocks                  meseingravel        travelnet
chat2                    mobs                tsm_mines
chat_anticurse           mobs_water-master   tutor
cottages                 moreblocks          Uberi-Minetest-WorldEdit-44c9576
datastorage              mr_goat             unified_inventory
destinations_2015_04_02  myadmin             viaduct
external_cmd             mydeck              vines

On https://github.com/bbmine/noob_academy. Notice the images for the folders "advtrains" and "letters". Also, those aren't really folders. The local repo actually has stuff in the folders.

Re: I need help with github

PostPosted: Thu Jan 26, 2017 14:26
by Morn76
BBmine wrote:On https://github.com/bbmine/noob_academy. Notice the images for the folders "advtrains" and "letters". Also, those aren't really folders. The local repo actually has stuff in the folders.

Make sure those subfolders are not git repos themselves. If they are, then run "rm -fr .git" inside them to turn them into regular folders.

Re: I need help with github

PostPosted: Thu Jan 26, 2017 14:35
by BBmine
Morn76 wrote:
BBmine wrote:On https://github.com/bbmine/noob_academy. Notice the images for the folders "advtrains" and "letters". Also, those aren't really folders. The local repo actually has stuff in the folders.

Make sure those subfolders are not git repos themselves. If they are, then run "rm -fr .git" inside them to turn them into regular folders.

Um, they are git repos. Okay, if they can't be git repos, then how do I make sure the most up-to-date stuff is being pushed?

Re: I need help with github

PostPosted: Thu Jan 26, 2017 14:44
by Morn76
BBmine wrote:Um, they are git repos. Okay, if they can't be git repos, then how do I make sure the most up-to-date stuff is being pushed?

You can use git submodules to create a link from your repository to either the latest versions or a specific commit of those mods.

But personally I've never done that; I always convert a mod to a regular folder, effectively forking it, so I can't tell you much more about how submodules work exactly.

Re: I need help with github

PostPosted: Thu Jan 26, 2017 17:37
by BBmine
Morn76 wrote:
BBmine wrote:Um, they are git repos. Okay, if they can't be git repos, then how do I make sure the most up-to-date stuff is being pushed?

You can use git submodules to create a link from your repository to either the latest versions or a specific commit of those mods.

But personally I've never done that; I always convert a mod to a regular folder, effectively forking it, so I can't tell you much more about how submodules work exactly.

I could make a folder called noob_academy_repos and pull --all the mods in that folder. Also in that script, I could have
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
rsync -truv --delete --exclude=".*/" noob_academy_repos/ noob_academy/