Showing posts with label Bitbucket. Show all posts
Showing posts with label Bitbucket. Show all posts

Tuesday 12 December 2017

How to check commit log of the particular file on Git or Bitbucket using terminal

How to check commit log of the particular file on Git or Bitbucket 


sudo git log -- app/code/local/jaydip/kansagra/controllers/CountryController.php

Thursday 22 September 2016

Adding an existing project to GitHub /Bitbucket using the command line

1. Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub.

2. Open Terminal.

3. Change the current working directory to your local project.

4. Initialize the local directory as a Git repository.
    $ git init

5. Add the files in your new local repository. This stages them for the first commit.
    $ git add .
    # Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.

6. Commit the files that you've staged in your local repository.
    $ git commit -m "First commit"
    # Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.

7. At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL.

8. In Terminal, add the URL for the remote repository where your local repository will be pushed.
    $ git remote add origin remote repository URL
    # Sets the new remote
    $ git remote -v
    # Verifies the new remote URL

9. Push the changes in your local repository to GitHub.
    $ git push origin master
    # Pushes the changes in your local repository up to the remote repository you specified as the origin

Friday 8 July 2016

How to change author name on GitHub/Bitbucket?

If you put your GitHub username and email account in those settings, your commits will accurately reflect your GitHub account as the right author.
$ git config --global user.name "Scott Chacon"
$ git config --global user.email "schacon@gmail.com"

Friday 24 June 2016

How do I delete/reset unpushed commits on Git / Bitbucket

Delete the most recent commit, keeping the work you've done:

git reset --soft HEAD~1

Delete the most recent commit, destroying the work you've done:

git reset --hard HEAD~1

Saturday 16 April 2016

How to ignore chmod/permission of files and directory changes on git/bitbucket

if you want a git/bitbucket repository to ignore permission changes (chmod),
type the following command into the Terminal while inside the git/bitbucket repository:

git config core.filemode false
It is usually possible to do this for all git repositories at once, instead of going one-by-one.
This is done by using the following command inside the Terminal (no need to be inside a git repository for this command):

git config --global core.filemode false