Posts

Showing posts with the label GitHub

How to create a new repository on the command line

Image
$ echo "# my-shop" >> README.md     $ git init   $ git add .   $ git commit -m "first commit"   $ git remote add origin https://github.com/sanuptpm/my-shop.git   $ git push -u origin master    

Ignoring unwanted files from github commit

Ignoring files From time to time, there are files you don't want Git to check in to GitHub. There are a few ways to tell Git which files to ignore. Create a local .gitignore If you create a file in your repository named .gitignore, Git uses it to determine which files and directories to ignore, before you make a commit.     1 ) In Terminal, navigate to the location of your Git repository.     2 ) Enter touch .gitignore to create a .gitignore file. If you already have a file checked in, and you want to ignore it, Git will not ignore the file if you add a rule later. In those cases, youuntrack the file first, by running the following command in your terminal: $ git rm --cached OR $ git rm --cached `git ls-files -i -X .gitignore`

How to submit edited changes git review

Clone from git $ git clone https://github.com/openstack/cinder.git Cloning into 'cinder'... remote: Counting objects: 42771, done. remote: Compressing objects: 100% (38/38), done. remote: Total 42771 (delta 17), reused 4 (delta 0) Receiving objects: 100% (42771/42771), 20.94 MiB | 52.00 KiB/s, done. Resolving deltas: 100% (27315/27315), done. Checking connectivity... done. Go to cinder directory $  cd cinder Get the latest Patch Set $ git fetch https://review.openstack.org/openstack/cinder refs/changes/12/110312/4 && git checkout FETCH_HEAD * branch refs/changes/12/110312/4 -> FETCH_HEAD Note: checking out 'FETCH_HEAD'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by p...

How to remove unwanted files from git after git commit

Please go to directory and run this $ git rm /home/sanu/cinder/cinder/volume/drivers/emc/emc_vnx_cli.py After editing recommitte your work $ git commit -a --amend $ git review -v

How to clone from github

Image
   Copy the HTTPS clone URL from github $ git clone https://github.com/openstack/glance.git

How to save output of git diff in local file

Image
you can get output result in local file with $ git diff > /home/sanu/myfile.diff

How to create a new repository on the command line in Github

Image
On your Git Hub profile click “new repository” brief description, choose the “public” repository option, and click “create repository”. 1)In the command line–make sure you cd into your folder–and type:  $ git init This initializes a git repository in your project 2)Next check if a file called READEME.rdoc exists in your directory:  $ ls README.rdoc If the file doesn’t exist, create it by typing:  $ touch README.rdoc 3)Then type:  $ git status This will list out all the files in your working directory. 4)Then type:  $ git add .  OR  $ git add filename.extension This adds all of your files & changes. 5)Then type:  $ git commit -m "first commit" This commits all of your files, adding the message “first commit” 6)Next type:  $ git remote add origin https://github.com/username/rails-girls.git This creates a remote, or connection, named “origin” pointing at the GitHub reposit...