Difference between revisions of "Git"

From wiki
Jump to navigation Jump to search
Line 1: Line 1:
Using the [https://bitbucket.org/ Bitbucket] code repository with git.
 
 
 
==Using Git==
 
==Using Git==
 
Here is a basic overview of how you can work with git@bitbucket works:
 
Here is a basic overview of how you can work with git@bitbucket works:
Line 23: Line 21:
 
;<code>git config --local -l</code>
 
;<code>git config --local -l</code>
 
:List your configuration for this repository (in the current directory).
 
:List your configuration for this repository (in the current directory).
 
+
;<code>git remote -v</code>
==Local setup==
+
:Show 'remote' configuration.
Install the git tools: <code>apt-get install git</code>
 
 
 
Initialize your user with:
 
:a name: <code>git config --global user.name "Your Name"</code>
 
:and email: <code>git config --global user.email "user@domain.tld"</code>
 
 
 
Set line endings correctly: <code>git config --global core.autocrlf input</code>
 
 
 
You homedir now has a .gitconfig files with this information
 
;<code>git config -l</code>
 
:List your configuration on user level
 

Revision as of 18:56, 10 May 2018

Using Git

Here is a basic overview of how you can work with git@bitbucket works:

  • Create a "repository" (project) with a git hosting tool (like Bitbucket)
Add you public key in Settings - 'Access keys'
  • Copy (or clone) the repository to your local machine
git clone <repoURL(replace https with ssh)>
  • Set push URL to https
git remote set-url --push origin <SSHrepoURL>
  • Add a file to your local repo and "commit" (save) the changes
git add <filenname>
  • "Push" your changes to your master branch
git push
  • Make a change to your file with a git hosting tool and commit
  • "Pull" the changes to your local machine
git pull
  • Create a "branch" (version), make a change, commit the change
  • Open a "pull request" (propose changes to the master branch)
  • "Merge" your branch to the master branch
git config --local -l
List your configuration for this repository (in the current directory).
git remote -v
Show 'remote' configuration.