Skip to content

Instantly share code, notes, and snippets.

@WasimMemon
Forked from gunjanpatel/git-config.md
Created February 21, 2014 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WasimMemon/9129562 to your computer and use it in GitHub Desktop.
Save WasimMemon/9129562 to your computer and use it in GitHub Desktop.

Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

For the first time clone your repository in to local linux.

    git clone https://your-local-repo-url/sample-php-app.git

Using Terminal

  1. For the very first time if you didn't configured remote repository then do it using this command.

     git remote add tasol https://<Your-userName>@bitbucket.org/tt2014/sample-php-app.git
    
  2. Fetch changes from remote repository.

    git fetch tasol 
    
  3. Configure local working branch:

Informative way

    git branch <new_local_branch_name> tasol/master
    git checkout <new_local_branch_name>

Recommended Way

    git checkout -b <new_local_branch_name> tasol/master         

or

    git merge tasol/master
  1. To Commit local branch

     git commit -a -m "Your commit message"
    
  2. Push you local branch on your Github Repository.

     git push origin <new_local_branch_name>
    

    If you want to push your local branch into new remote branch then

     git push origin <new_local_branch_name>:<remote_branch_name>
    
  • Discard uncommitted changes

      git checkout -- .
    
  • Remove your all local git branches

      git branch -D `git branch --merged | grep -v \* | xargs`
    

Enjoy GIT with Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment