SlideShare uma empresa Scribd logo
1 de 5
GIT SETUP ON LINUX WITH BITBUCKET
Step 1. Install git on your PC
→ Open Terminal (ctrl+alt+t)
→ $ sudo apt-get install git
Verify the installation was successful by typing which git at the command line.
→ $ which git
“/usr/bin/git”
Configure your username using the following command.
→ $ git config --global user.name “Git_USER_NAME”
Configure your email address using the following command.
→ $ git config --global user.email “xyz@atlassian.com"
CREATE BITBUCKET REPOSITORY
Step 2. Create a repository on Bit-bucket
To create a repository, follow these steps:
1. Log into Bit-bucket Cloud under your individual account on https://bitbucket.org
2. Click Repositories > Create repository or the Create new repository link.
3. Choose a repository Owner.
This only appears if you are creating under an account with membership in one or more
teams.
4. Enter a Name and Description for your repository.
5. Tick Private if you want to hide your repository from the general public, so that only
selected people can see it.
6. Select the Repository type.
7. Click Create repository.
Step 3. Repository setup
→ $ mkdir /path/to/your/project
→ $ cd /path/to/your/project
→ $ git init
→ $ git add —all
Note: check status of adding file “Green files means chosen for repository”
→ git status
→ $ git remote add origin https://user_name@bitbucket.org/yourRepos.git
This is repositories path
→ $git commit -m 'Initial commit with contributors’
→ $git push -u origin master
Step 4. Create Branch on Bit-bucket
Branch-> Create Branch
Step 5. Clone Repositories
→ $ git clone https://user_name@bitbucket.org/yourRepos.git(remote
address)
Step 6. Using Git to checkout a branch on the command line
→ $ cd gitProject
→ $ git fetch && git checkout yourBranchName (Most Imp to change
branch for fetch & checkout)
→ $git branch -a
* yourBranchName
remotes/origin/HEAD -> origin/master
remotes/origin/abc_dev
remotes/origin/development
remotes/origin/master
remotes/origin/ yourBranchName
(The green colour of text with asterisk before it, showing that your current branch on which
you are.)
Step 7. Changes staging for commit
→ git add <file>( make a .gitignore file and add file names which
you don't want to commit on remote, and add into your project.)
→ git status
green files means added for commit
→ $ git commit -m 'commit message'
→ $ git push origin branch_name(on which you want to push code)
Provide username & password
Step 8. Pull (Daily Basis before push)
→ $ git pull origin branch_name (from which you want to pull)
DIFFERENCE B/W CHECKOUT & CLONE
To sum it up, clone is for fetching repositories you don't have, checkout is for switching
between branches in a repository you already have.
→ $ git checkout branch_name(from where you want to check out)
Once you completed all the above now follow the steps below…
1.Open your project on any editor (for eg. VSCode).
2. Make some changes in your files.
3. On the left menu on VSCode you find an option for git (or shortcut->> ctrl+shift+G). now you
can see the files on which you changed the code, once you ensure the changes, you need to commit
the code, now open terminal ( press ctrl+alt+t).
i. $ cd /path/to/your/project
ii . $ git status
(this will show you modified file names with path)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: app/folderName/file1.js
modified: app/folderName/file2.js
if you added new file in project which you didn't push yet that will show like this Untracked files:
(use "git add < file>..." to include in what will be committed)
newFile.js
iii. $ git add <fileName> (on which changes done -->> git add app/projectFolder/xyz.js ).
check status after add new files
iv. git status (After Adding)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: app/projectFolder/xyz.js
Changes not staged for commit:
(use "git add < file>..." to update what will be committed)
(use "git checkout -- < file>..." to discard changes in working directory)
modified: app/projectFolder/abc.js
Untracked files:
(use "git add < file>..." to include in what will be committed)
newFolder/newFile.js
(you can add files for commit as above)
v. $ git commit -m 'changes in xyz page'
“[your_branch_name ab3caa3] changes in xyz page
1 file changed, 9 insertions(+), 9 deletions(-)”
(you can also check the status of you commit by entering command $ git status )
iv. you can see the logs by entering command
$ git log
(show all commits in the current branch’s history, press 'q' from exit log window)
you can see the difference by entering command
$ git diff
(this will show you the difference between files, diff of what is changed but not staged press 'q'
for exit )
vi. now push your code to remote.
Before push code you can set your bit bucket password into your git config file
run commands
$ gedit .git/config
(This will open your git config file in editor now you can set or change password from here.)
[remote “origin"]
url = https://user_name:password@bitbucket.org/daffodilsoftware/yourRepos.git
fetch = +refs/heads/*:refs/remotes/origin/*
(Note : Do not use '@' in your password it will give error while pushing)
$ git push
(Transmit local branch commits to the remote repository branch)
Message on terminal—>>
“Counting objects: 16, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 483 bytes | 0 bytes/s, done.
Total 5 (delta 4), reused 0 (delta 0)
remote:
remote: Create pull request for yourBranchName:
remote https://bitbucket.org/daffodilsoftware/yourRepos/pull-requests/new?
source=YourBranchName&t=1
remote:
To https://userName:Password@bitbucket.org/daffodilsoftware/yourRepos.git
commit Id YourBranchName - > YourBranchName”
vii. Now its time to merge the code to your master branch or the branch you want
$ git merge [alias]/[branch]
merge a remote branch into your current branch to bring it up to date .
viii. $ git pull
'fetch and merge any commits from the tracking remote branch'
Some other useful command
REWRITE HISTORY
Rewriting branches, updating commits and clearing history
$ git rebase [branch]
apply any commits of current branch ahead of specified one
$ git reset --hard [commit]
clear staging area, rewrite working tree from specified commit
$ git log branchB..branchA
show the commits on branchA that are not on branchB
git show
show any object in Git in human-readable format
git reset [file]
Unstage a file while retaining the changes in working directory.
Remove git initialization
$ rm -rf .git
Display current git configuration
$ cat .git/con g
$ git con g user.name “username”
$ git config user.email “email”

Mais conteúdo relacionado

Mais procurados

HotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePushHotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePushEvan Schultz
 
Web components Introduction
Web components IntroductionWeb components Introduction
Web components IntroductionEugenio Romano
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Atlassian
 
Continuous Web Performance Monitoring with Jenkins
Continuous Web Performance Monitoring with JenkinsContinuous Web Performance Monitoring with Jenkins
Continuous Web Performance Monitoring with JenkinsMichael Kröll
 
Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2Vikas Chauhan
 
The Joy of Gems: Cooking up Rails Plugins
The Joy of Gems: Cooking up Rails PluginsThe Joy of Gems: Cooking up Rails Plugins
The Joy of Gems: Cooking up Rails PluginsPaul McMahon
 
Play with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularPlay with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularEugenio Romano
 
Bugzilla Installation Process
Bugzilla Installation ProcessBugzilla Installation Process
Bugzilla Installation ProcessVino Harikrishnan
 
sbt 0.10 for beginners?
sbt 0.10 for beginners?sbt 0.10 for beginners?
sbt 0.10 for beginners?k4200
 
Modern Web Developement
Modern Web DevelopementModern Web Developement
Modern Web Developementpeychevi
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingAlessandro Molina
 
Creating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with ReactCreating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with Reactpeychevi
 
Simple restfull app_s
Simple restfull app_sSimple restfull app_s
Simple restfull app_snetwix
 

Mais procurados (20)

HotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePushHotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePush
 
Web components Introduction
Web components IntroductionWeb components Introduction
Web components Introduction
 
Elefrant [ng-Poznan]
Elefrant [ng-Poznan]Elefrant [ng-Poznan]
Elefrant [ng-Poznan]
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
 
Chef training Day5
Chef training Day5Chef training Day5
Chef training Day5
 
Auto Build
Auto BuildAuto Build
Auto Build
 
Pundit
PunditPundit
Pundit
 
Continuous Web Performance Monitoring with Jenkins
Continuous Web Performance Monitoring with JenkinsContinuous Web Performance Monitoring with Jenkins
Continuous Web Performance Monitoring with Jenkins
 
Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2
 
The Joy of Gems: Cooking up Rails Plugins
The Joy of Gems: Cooking up Rails PluginsThe Joy of Gems: Cooking up Rails Plugins
The Joy of Gems: Cooking up Rails Plugins
 
Devise and Rails
Devise and RailsDevise and Rails
Devise and Rails
 
Play with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularPlay with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 Angular
 
Bugzilla Installation Process
Bugzilla Installation ProcessBugzilla Installation Process
Bugzilla Installation Process
 
sbt 0.10 for beginners?
sbt 0.10 for beginners?sbt 0.10 for beginners?
sbt 0.10 for beginners?
 
Modern Web Developement
Modern Web DevelopementModern Web Developement
Modern Web Developement
 
Laravel 101
Laravel 101Laravel 101
Laravel 101
 
React on es6+
React on es6+React on es6+
React on es6+
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears Training
 
Creating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with ReactCreating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with React
 
Simple restfull app_s
Simple restfull app_sSimple restfull app_s
Simple restfull app_s
 

Destaque

как люди научились считать 6 класс 1
как люди научились считать 6 класс 1как люди научились считать 6 класс 1
как люди научились считать 6 класс 1елена шапошникова
 
They say bad news comes in threes: After Nokia and Blackberry, now it’s HTC’...
They say bad news comes in threes:  After Nokia and Blackberry, now it’s HTC’...They say bad news comes in threes:  After Nokia and Blackberry, now it’s HTC’...
They say bad news comes in threes: After Nokia and Blackberry, now it’s HTC’...Jason Fernandes
 
Apple's acquisition of beats what the doctor ordered
Apple's acquisition of beats what the doctor orderedApple's acquisition of beats what the doctor ordered
Apple's acquisition of beats what the doctor orderedJason Fernandes
 
How Ellen Pao became Reddit’s Lee Harvey Oswald
How Ellen Pao became Reddit’s  Lee Harvey OswaldHow Ellen Pao became Reddit’s  Lee Harvey Oswald
How Ellen Pao became Reddit’s Lee Harvey OswaldJason Fernandes
 
Cuadrante exámenes de septiembre
Cuadrante exámenes de septiembreCuadrante exámenes de septiembre
Cuadrante exámenes de septiembreIes Almina
 
Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...
Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...
Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...Jason Fernandes
 
AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...
AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...
AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...Jason Fernandes
 

Destaque (7)

как люди научились считать 6 класс 1
как люди научились считать 6 класс 1как люди научились считать 6 класс 1
как люди научились считать 6 класс 1
 
They say bad news comes in threes: After Nokia and Blackberry, now it’s HTC’...
They say bad news comes in threes:  After Nokia and Blackberry, now it’s HTC’...They say bad news comes in threes:  After Nokia and Blackberry, now it’s HTC’...
They say bad news comes in threes: After Nokia and Blackberry, now it’s HTC’...
 
Apple's acquisition of beats what the doctor ordered
Apple's acquisition of beats what the doctor orderedApple's acquisition of beats what the doctor ordered
Apple's acquisition of beats what the doctor ordered
 
How Ellen Pao became Reddit’s Lee Harvey Oswald
How Ellen Pao became Reddit’s  Lee Harvey OswaldHow Ellen Pao became Reddit’s  Lee Harvey Oswald
How Ellen Pao became Reddit’s Lee Harvey Oswald
 
Cuadrante exámenes de septiembre
Cuadrante exámenes de septiembreCuadrante exámenes de septiembre
Cuadrante exámenes de septiembre
 
Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...
Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...
Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...
 
AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...
AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...
AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...
 

Semelhante a Git setuplinux

Understanding about git
Understanding about gitUnderstanding about git
Understanding about gitSothearin Ren
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Brian K. Vagnini
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubDSC GVP
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitE Carter
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)bryanbibat
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlBecky Todd
 
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer CheatsheetAbdul Basit
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceForest Mars
 
Practical git for developers
Practical git for developersPractical git for developers
Practical git for developersWim Godden
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and githubAderemi Dadepo
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in UnityRifauddin Tsalitsy
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleGaurav Kumar Garg
 

Semelhante a Git setuplinux (20)

Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git101
Git101Git101
Git101
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
 
Git github
Git githubGit github
Git github
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
 
Git
GitGit
Git
 
Git basic
Git basicGit basic
Git basic
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
 
Git
GitGit
Git
 
Git training
Git trainingGit training
Git training
 
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSource
 
Practical git for developers
Practical git for developersPractical git for developers
Practical git for developers
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
 

Último

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Último (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

Git setuplinux

  • 1. GIT SETUP ON LINUX WITH BITBUCKET Step 1. Install git on your PC → Open Terminal (ctrl+alt+t) → $ sudo apt-get install git Verify the installation was successful by typing which git at the command line. → $ which git “/usr/bin/git” Configure your username using the following command. → $ git config --global user.name “Git_USER_NAME” Configure your email address using the following command. → $ git config --global user.email “xyz@atlassian.com" CREATE BITBUCKET REPOSITORY Step 2. Create a repository on Bit-bucket To create a repository, follow these steps: 1. Log into Bit-bucket Cloud under your individual account on https://bitbucket.org 2. Click Repositories > Create repository or the Create new repository link. 3. Choose a repository Owner. This only appears if you are creating under an account with membership in one or more teams. 4. Enter a Name and Description for your repository. 5. Tick Private if you want to hide your repository from the general public, so that only selected people can see it. 6. Select the Repository type. 7. Click Create repository. Step 3. Repository setup → $ mkdir /path/to/your/project → $ cd /path/to/your/project → $ git init → $ git add —all Note: check status of adding file “Green files means chosen for repository” → git status → $ git remote add origin https://user_name@bitbucket.org/yourRepos.git This is repositories path → $git commit -m 'Initial commit with contributors’ → $git push -u origin master Step 4. Create Branch on Bit-bucket
  • 2. Branch-> Create Branch Step 5. Clone Repositories → $ git clone https://user_name@bitbucket.org/yourRepos.git(remote address) Step 6. Using Git to checkout a branch on the command line → $ cd gitProject → $ git fetch && git checkout yourBranchName (Most Imp to change branch for fetch & checkout) → $git branch -a * yourBranchName remotes/origin/HEAD -> origin/master remotes/origin/abc_dev remotes/origin/development remotes/origin/master remotes/origin/ yourBranchName (The green colour of text with asterisk before it, showing that your current branch on which you are.) Step 7. Changes staging for commit → git add <file>( make a .gitignore file and add file names which you don't want to commit on remote, and add into your project.) → git status green files means added for commit → $ git commit -m 'commit message' → $ git push origin branch_name(on which you want to push code) Provide username & password Step 8. Pull (Daily Basis before push) → $ git pull origin branch_name (from which you want to pull) DIFFERENCE B/W CHECKOUT & CLONE To sum it up, clone is for fetching repositories you don't have, checkout is for switching between branches in a repository you already have. → $ git checkout branch_name(from where you want to check out)
  • 3. Once you completed all the above now follow the steps below… 1.Open your project on any editor (for eg. VSCode). 2. Make some changes in your files. 3. On the left menu on VSCode you find an option for git (or shortcut->> ctrl+shift+G). now you can see the files on which you changed the code, once you ensure the changes, you need to commit the code, now open terminal ( press ctrl+alt+t). i. $ cd /path/to/your/project ii . $ git status (this will show you modified file names with path) Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: app/folderName/file1.js modified: app/folderName/file2.js if you added new file in project which you didn't push yet that will show like this Untracked files: (use "git add < file>..." to include in what will be committed) newFile.js iii. $ git add <fileName> (on which changes done -->> git add app/projectFolder/xyz.js ). check status after add new files iv. git status (After Adding) Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: app/projectFolder/xyz.js Changes not staged for commit: (use "git add < file>..." to update what will be committed) (use "git checkout -- < file>..." to discard changes in working directory) modified: app/projectFolder/abc.js Untracked files: (use "git add < file>..." to include in what will be committed) newFolder/newFile.js (you can add files for commit as above) v. $ git commit -m 'changes in xyz page' “[your_branch_name ab3caa3] changes in xyz page 1 file changed, 9 insertions(+), 9 deletions(-)” (you can also check the status of you commit by entering command $ git status ) iv. you can see the logs by entering command $ git log (show all commits in the current branch’s history, press 'q' from exit log window) you can see the difference by entering command $ git diff
  • 4. (this will show you the difference between files, diff of what is changed but not staged press 'q' for exit ) vi. now push your code to remote. Before push code you can set your bit bucket password into your git config file run commands $ gedit .git/config (This will open your git config file in editor now you can set or change password from here.) [remote “origin"] url = https://user_name:password@bitbucket.org/daffodilsoftware/yourRepos.git fetch = +refs/heads/*:refs/remotes/origin/* (Note : Do not use '@' in your password it will give error while pushing) $ git push (Transmit local branch commits to the remote repository branch) Message on terminal—>> “Counting objects: 16, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 483 bytes | 0 bytes/s, done. Total 5 (delta 4), reused 0 (delta 0) remote: remote: Create pull request for yourBranchName: remote https://bitbucket.org/daffodilsoftware/yourRepos/pull-requests/new? source=YourBranchName&t=1 remote: To https://userName:Password@bitbucket.org/daffodilsoftware/yourRepos.git commit Id YourBranchName - > YourBranchName” vii. Now its time to merge the code to your master branch or the branch you want $ git merge [alias]/[branch] merge a remote branch into your current branch to bring it up to date . viii. $ git pull 'fetch and merge any commits from the tracking remote branch'
  • 5. Some other useful command REWRITE HISTORY Rewriting branches, updating commits and clearing history $ git rebase [branch] apply any commits of current branch ahead of specified one $ git reset --hard [commit] clear staging area, rewrite working tree from specified commit $ git log branchB..branchA show the commits on branchA that are not on branchB git show show any object in Git in human-readable format git reset [file] Unstage a file while retaining the changes in working directory. Remove git initialization $ rm -rf .git Display current git configuration $ cat .git/con g $ git con g user.name “username” $ git config user.email “email”