remove git secrets from Ubuntu - ubuntu-16.04

I have added git secrets to ubuntu(16.04 LTS) and it was working fine until I was executing these commands,
git secrets --register-aws
git secrets --install ~/.git-templates/git-secrets
git config --global init.templateDir ~/.git-templates/git-secrets
I have removed these files,
~/.git-templates/git-secrets
/usr/bin/git-secrets
from my environment, but still it seems not working fine.
git secrets --scan , gives nothing
How do I remove git-secrets permanently from my PC and re-install or solve this issue.

Currently we need to do this manually.
Delete secrets from .git/config for all local repositories.
Delete secrets from .gitconfig.
Remove commit-msg, pre-commit and prepare-commit-msg hooks from all git repositories.
Change/remove git template so that it does not configure these hooks for newer repos.
Uninstall binary. Following are the multiple places you can look in the Linux based machine.
i. By default all the git core command scripts are available in /usr/lib/git-core/ directory.
ii. Apart from that, you can check in /usr/bin/ and /usr/local/bin/ directories as well.
iii. If you are still NOT able to find the binary, then type which git-secrets to identify the place where actually git-secrets is installed.
There is an issue created for the same in GitHub. You can check the progress in there as well.

Related

Rstudio: Changing origin for git version control of project

I originally set up git in Rstudio while enrolled in the Data Scientist's Toolbox course at Coursera. Unfortunately, I did this in my phd project. The repository no longer exists on github. I am now attempting to write my thesis in rmarkdown using knitr and bookdown. I would like to use version control, both to learn proper git workflow and to have a structured back up of everything I have done in my thesis. However, I have been unable to change the version control repository in Rstudio.
I am unable to change this in the Tools > Version control > Project setup > Git/SVN menu. The Origin: textbox is unchangable.
I tried creating a new project using the old phd project's working directory. This also cloned the version control settings.
How do I change the origin to accomplish what is described above?
Git, Github and Rstudio are different things. You could use git as local version control tools. You might connect your local repo to Github account which is based on git by push/pull. Rstudio just makes a user interface for git and supplies the function to push the repo into remote server based on git to make version control(not only Github, but also Gitlab).
So for your issue, if you do not want to pay for github for a private repo, all of your code would be public and I don't think it is good before your finally finished your thesis. But version control could be made locally with git only. Just use git shell to control the version.
However, as a student, github could support private repo here for you. Just register and find your student package. Then just remove the url for remote repo after you cd to your workdir in command line, use the following code to find your remote url(mostly you might fing origin):
git remote -v
Then use this to remove them:
git remote rm origin
Now you could use version control locally. If you want to connect this repo to your remote github private repo, use this:
git remote add origin https://github.com/[YourUsername]/[YourRepoName].git
RStudio would find this information about git and support your following operation. Project in RStudio is different with git, although project support git as version control tool. So you need git in command line or shell to solve your problem.
This can be done by opening /your.project/.git/config
and editing the remote origin line(s), e.g. changing from git to https.
Restart Rstudio & you'll be prompted for your github username & password.
This is what worked for me for migrating from github to Azure
Go to the top right Git window in RStudio and click on the gear. Now click Shell (to open the terminal there).
#remove origin
git remote rm origin
#add new origin like Azure for me via HTTPS
git remote add origin https://USER#dev.azure.com/USER/PROJECT/_git/REPONAME
#push your local repro
git push -u origin --all
#in my case put in the PAT password if you needed to generate one.
After testing, I found some clue
Actually Rstudio is not really smart about this setting
It will first search for the git file in the Rproject folder where your Rporject file is located
if it could not, then it goes up to the folder contains your Rproject folder
However, for version control you only need coding files while RProject may contains some big files like .RData some pictures etc.
I don't find a way to manually disrupt this logic flow, the only thing you can do is to delete the current git repository setting files(which is .git folder and 2 other git setting files), then Rstudio may ask you if you want to init a new one.

How to use git lfs with Visual Studio Team Services hosted build agents

I use git lfs to store the large files of my git repo. I then try to build this repo with hosted agents. My build is pretty simple. It has a single task: Execute PowerShell. In the invoked script, the first thing that I want to do is to fetch my lfs dependencies. I therefore have the following in my script:
& git lfs fetch
Unfortunately, my build fails with the following error:
2016-03-04T19:49:05.7021988Z ##[error]git: 'lfs' is not a git command. See 'git --help'.
2016-03-04T19:49:05.7031986Z ##[error]Did you mean this?
2016-03-04T19:49:05.7041987Z ##[error] flow
Since I can't install anything on hosted agents, how am I supposed to have git lfs available?
EDIT
In this issue, I am not talking about git lfs authentication problems as described here. I am strictly talking about the issue of calling git lfs.
Once you are able to call git lfs, look at this answer to solve the authentication problem.
Git LFS is now supported by default on the Hosted Build Controller. But you do need to enable it in your get sources step.
You get this error message because git-lfs isn't installed on Hosted Build Agent by default.
And since you are using Hosted Build Agent, it would be a little troublesome to install git-lfs via Chocolatey on it as you don't have administrator permission. An alternative way would be download the binary files for git-lfs directly and upload it into Source Control. Then you can invoke the git-tfs.exe with an absolute path in your script.
Here are some more details around the solution provided by Eddie. git lfs is not a built-in command. It is a git custom command.
When you call git lfs, git.exe does not know about the lfs command. So it looks in the PATH environment variable and searches for a program named git-lfs.exe. Once found, it calls that program with the provided argument.
So calling git-lfs.exe pull is equivalent to calling git.exe lfs pull.
The solution suggested is therefore to download git-lfs.exe, add it your git repo (it should obviously not be tracked by LFS), and call git-lfs.exe.
It is also possible to add the folder that contains git-lfs.exe to your path environment variable. This makes it possible to use commands like git.exe lfs pull as you usually do.
If you are allowed to install software and have internet access during build you might be able to install git-lfs using the Chocolatey package in a cmd / PowerShell task prior to your git-lfs operation.

openshift rhc you do not have git installed

I am trying to setup the rhc client for openshift. I followed the tutorial precisely. After installing ruby, git and the rhc gem, the setup went perfect. But it wont clone my app to my computer. When I type rhc git-clone it says that git is not installed, but git --version works fine.
Ok, git installs itself default in users\\appdata\local\Git . I read somewhere that you shouldn't mess with the folder. But older versions installed in program files. So i tried that and rhc found it immediatly.
So just install git in C:\Program Files\Git
Just an additional piece of information to RiverWalker's self answer: run the git install as 'administrator'. Then "C:\Program Files\Git" directory will be used as the default installation dir.

Setup a development environment git + centos + Eclipse egit on windows

I am setting up a development environment in my home. I have installed a centos linux in a virtual machine. All files in /var/www/html are shared with samba.
I have access to these files in windows. I have installed git in centos. I created a git repository in a sub directory of /var/www/html.
I am using Eclipse in windows. Egit is installed in Eclipse. I tried to add repository in eclipse but when I do a commit in egit, "git status" in linux displays a list of modified files to commit. Also when I do a commit in linux, all files in egit will be marked az modified.
I don't know how to synchronize egit with git. What is the correct way to do this?
The easiest solution by far would be to use a cloud service such as GitHub (or BitBucket if you want free private repositories).
An example workflow is (on terminal, however your clients will have GUI options for this):
$ git remote add origin git#bitbucket.org:username/repository
$ git push origin master
The on your other client fetch the changes and merge them in through pull
$ git pull
Both sides will need to have the same remote repository - This way you can push - pull wherever you do the work and the code be the same. I use this setup for developing and deploying my web-apps.
This solution relies on you having an internet connection - if you dont want or dont have an internet connection at your disposal then have a look at this post:
gitosis vs gitolite?

git push error "fatal: Unable to find remote helper for 'https'"

I've added remote origin like:
git remote add origin https://github.com/username/repo.git
When I push the git repository, I get this error:
git push -u origin master
fatal: Unable to find remote helper for 'https'
I am on git 1.7.1 on Ubuntu 10.04.4 LTS
Any ideas, greatly appreciated
If you compiled git from source, be sure to install this package first:
apt-get install libcurl4-openssl-dev
I just got the problem yesterday and solved it today, so am posting in case this might help a Windows user. For me, the problem occurred after I updated to the latest version of Git (because Visual Studio was recommending I do so-- something about things not matching.)
It turns out that I installed in the default directory Program Files, but my old Git was in Program Files (x86). (Hadn't noticed until tried reinstalling.)
Uninstalling the new version and installing the 64-bit Git for Windows Setup listed under Other Git for Windows downloads (which is not the default) overlaying the version in Program Files (x86) worked. (I tried other combinations of version and folders first.)
I did have to delete the local repository already created and restart with git init, git add ., git commit -m "first commit", git remote add origin theGitUrl (all of which worked before), before doing the git push origin master. The weird thing is that a pop-up window appeared to enter my user name and password. I didn't notice it at first and thought the processing on the git push was hung up. So, heads up about that "Other Git for Windows" version.
I did change my Environmental Variables before the fix; I don't know if that helped. I added these 2 to the PATH:
C:\Program Files (x86)\Git\bin
C:\Program Files (x86)\Git\libexec\git-core
I did this for both User and System variables.
A note on updating the PATH in Windows 10: you have to add one at a time and not include the ;
After much searching, the answer is you need git version 1.7.7
Can't update RVM - "fatal: Unable to find remote helper for 'http'"
I was working in a chroot jail and thought i had copied everything i needed for git to work but i was missing the git-core files themselves so i just had to copy them:
cp -r /usr/lib/git-core /opt/chroot/myjail/usr/lib/
Add this to git config: (Checked in centos 6.7 and working)
#git config --global url.https://.insteadOf git://
#To see the config added
#git config --list
url.https://.insteadof=git://
user.name=username
user.email=youremail
....