Re: [git-users] How to remove a project or folder pushed by mistake with original project to master branch???

2015-12-15 Thread Ryan Milligan
I know this is kind of an old post, but in case anybody comes across this 
answer, you can also use "--force-with-lease" instead of "--force" to do 
the push only if there have been no changes to the upstream history since 
the last time you fetched. This solves the risk Nelson brought up of 
accidentally overwriting other people's changes.

On Tuesday, November 24, 2015 at 4:39:42 AM UTC-8, Moazzam Shahzad wrote:
>
> ok I will do the sameThankyou for helping...
>
> On Tue, Nov 24, 2015 at 5:35 PM, Nelson Efrain A. Cruz  > wrote:
>
>> Hi, in git there is no concept about "rights". I assume you are using 
>> some tool to manage git repos like gitlab or github. Anyway two options 
>> come to my mind right now:
>>
>> Make a new commit erasing the folder that you dont want, with this 
>> approach the folder will be in the history so you can checkout to a commit 
>>  where the folder is present wich is bad if you dont want those files in 
>> the history of the repo.
>>
>> Change your las commit and (force) push it, with this approach you need 
>> to be careful of rewriting history, basically if you are alone in the repo 
>> you are safe if not well you need to be sure that anyone have pulled the 
>> history. For this read [1]
>>
>> 1 - 
>> https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-the-Last-Commit
>>
>> El mar., 24 de nov. de 2015 a la(s) 9:03 a. m., Moazzam Shahzad <
>> moazzams...@gmail.com > escribió:
>>
>>> I have master rights on git repository.
>>> How to remove a project or folder pushed by mistake  with original 
>>> project to master branch???
>>>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Git for human beings" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to git-users+...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Git for human beings" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/git-users/413VcP7_cL8/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> git-users+...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How to remove a project or folder pushed by mistake with original project to master branch???

2015-11-24 Thread Moazzam Shahzad
ok I will do the sameThankyou for helping...

On Tue, Nov 24, 2015 at 5:35 PM, Nelson Efrain A. Cruz 
wrote:

> Hi, in git there is no concept about "rights". I assume you are using some
> tool to manage git repos like gitlab or github. Anyway two options come to
> my mind right now:
>
> Make a new commit erasing the folder that you dont want, with this
> approach the folder will be in the history so you can checkout to a commit
>  where the folder is present wich is bad if you dont want those files in
> the history of the repo.
>
> Change your las commit and (force) push it, with this approach you need to
> be careful of rewriting history, basically if you are alone in the repo you
> are safe if not well you need to be sure that anyone have pulled the
> history. For this read [1]
>
> 1 -
> https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-the-Last-Commit
>
> El mar., 24 de nov. de 2015 a la(s) 9:03 a. m., Moazzam Shahzad <
> moazzamshahza...@gmail.com> escribió:
>
>> I have master rights on git repository.
>> How to remove a project or folder pushed by mistake  with original
>> project to master branch???
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Git for human beings" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to git-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Git for human beings" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/git-users/413VcP7_cL8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.