Re: [mh] Git woes

Jeff Siddall via misterhouse-users <[email protected]>
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <[email protected]>
Giles,

I am not a wizard of git so below are some of my notes on getting it to 
do what I want.

One command that I used to get rid of extra stuff in the pull request is:

     git reset --hard origin/master

Or, to go back to a specific commit:

git reset --hard <commit_id>
git cherry-pick <commit_id>

Good Luck!

----------

Basic steps are:
git checkout -b <branch_name>

Modify code as required, then add each new/modified file:

git add <filename>

Then commit the changes and:

git commit -m "<descriptive message>"
git push origin <branch_name>

Then go into github and create a pull request

Other useful git commands:

Make sure you are on the local master branch

     git checkout master

Show the current upstream of a fork:

     git remote -v

To resync a fork of a project with the upstream run:

     git fetch upstream

To merge those changes into the local repository run:

     git merge upstream/master

To replace a local repository with the upstream master run:

     git reset --hard origin/master

To force an update to a branch run:

     git push -f origin <branch_name>

To show the current status, including the current branch and what has 
been done run:

     git status


On 2020-12-21 1:12 a.m., Giles Godart-Brown wrote:
>
> I think it may have worked by adding a -n to the commit viz;
>
> git commit -n -m "adding wildcards and LWT to mqtt.pm"
>
> Looking at the pull request it seems to include a lot more than just 
> mqtt.pm which is the only file I changed
>
> Giles
>
> On 20/12/2020 16:35, Giles Godart-Brown wrote:
>>
>> I'm trying to get my contribution into Git for the mqtt wildcards and 
>> LWT, but I'm getting a Git error that I cannot seem to solve.
>>
>> Here is what I did.
>>
>> git branch mqtt_LWT_wildcards
>>
>> git checkout mqtt_LWT_wildcards
>>
>> edit mqtt.pm
>>
>> git stage mqtt.pm
>> git commit
>>
>> this gives the following error;
>>
>> bin/githook-perltidy pre-commit:
>>     # saving non-indexed changes and tidying
>>     git stash save --quiet --keep-index bin/githook-perltidy 
>> 2020-12-20T16:30:09
>>     git checkout-index -a
>> lib/mqtt.pm already exists, no checkout
>> git checkout-index -a failed: 32768 at bin/githook-perltidy line 36, 
>> <$fh> line 2.
>>     main::run('git', 'checkout-index', '-a') called at 
>> bin/githook-perltidy line 165
>>
>> bin/githook-perltidy: pre-commit FAIL! Restoring...
>>     git reset --hard
>> HEAD is now at e78531f4 Merge pull request #804 from 
>> jsiddall/MQTT_table_support
>>     git stash pop --quiet --index
>>
>> I'm a complete novice with Git, so probably ding something wrong, can 
>> someone help?
>>
>> Thanks
>>
>> Giles
>>
>
>
> ________________________________________________________
> To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>

________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.