Skip to main content

how to setup git in windows machine



how to setup git in windows machine
#install github for windows - https://git-for-windows.github.io/
#create folder
#select folder right click and git bash here
in cmd line use
or create a new repository on the command line

echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/spectrumted/test.git
git push -u origin master

…or push an existing repository from the command line

git remote add origin https://github.com/spectrumted/test.git
git push -u origin master

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
to add git on webserver
download putty
give cpanel domain as host port 22 then ok
enter username password
then at the root cpanel

From your home directory( cd ~/ ), get the rpm:
$ wget http://pkgs.repoforge.org/git/git-1.7.9.6-1.el5.rf.i386.rpm
Install & Configure Git
Unpack git using rpm2cpio and cpio:
        mkdir ~/opt
        cd ~/opt
        rpm2cpio ~/git-1.7.9.6-1.el5.rf.i386.rpm | cpio -id      
Check that it is installed:
        ~/opt/usr/bin/git --version
        git version 1.7.9.6      
Configure git to work on your path and not to do SSL verification. Create a ~/.bash_profile file, if not already existing and add the following to it:(use vi ~/.bash_profile)
        export GIT_SSL_NO_VERIFY=true
        PATH=$PATH:$HOME/opt/usr/bin
        export PATH
        GIT_EXEC_PATH=$HOME/opt/usr/libexec/git-core
        export GIT_EXEC_PATH      
Check these settings by logging out and back in. Then check the version:
        git --version
        git version 1.7.9.6
       
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
to undo a commit
git reset --hard HEAD~1
will get u back by one commit
git reset --soft HEAD^     # use --soft if you want to keep your changes
git reset --hard HEAD^     # use --hard if you don't care about keeping the changes you made

Now git log will show that our last commit has been removed.
How to undo a public commit

If you have already made your commits public, you will want to create a new commit which will "revert" the changes you made in your previous commit (current HEAD).

git revert HEAD
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Change the URI (URL) for a remote Git repository
git remote -v
# View existing remotes
# origin  https://github.com/user/repo.git (fetch)
# origin  https://github.com/user/repo.git (push)

git remote set-url origin https://github.com/user/repo2.git
# Change the 'origin' remote's URL

git remote -v
# Verify new remote URL
# origin  https://github.com/user/repo2.git (fetch)
# origin  https://github.com/user/repo2.git (push)

Comments

Popular posts from this blog

Error: ios-deploy was not found. Please download, build and install version 1.9.0 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy' solution this solved the issue sudo npm install -g ios-deploy -unsafe-perm

Error: ios-deploy was not found. Please download, build and install version 1.9.0 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy' solution this solved the issue sudo npm install -g ios-deploy -unsafe-perm

How to upload file in MEAN Stack

How to upload file in MEAN Stack Do these steps 1. npm install ng-file-upload 2. include ng-file-upload.min.js in your angular index .html 3. Use this example to copy form to your angular page from where u want to upload file. -- http://jsfiddle.net/0m29o9k7/ or http://jsfiddle.net/danialfarid/2vq88rfs/136/ Copy this code outside of any form which is already there: 4. Change this url from example code to where you want to upload files -- url: 'https://angular-file-upload-cors-srv.appspot.com/upload', 6. In your server.js or app.js which ever you are using as (node server.js) to start app add these lines     var crypto = require('crypto');         var mime = require('mime');         var multer  = require('multer');                     var storage = multer.diskStorage({           destination: function (req, file, cb) {     ...